Let's get some more details on what this tiny NPM diploid package is going to do.
So, again, it's just for practice on deploying off to NPM because like I said, there are going to
be some very small issues we run into once we start deploying all three of our packages inside of a
tiny NPM deploy, we're going to write out a single typescript file called Indexed US.
At some point in time, we're going to run that file through the typescript compiler and then produce
an index file.
Now, it is really this indexed JS file that we want to deploy off to NPM in general.
Whenever we publish a package, we publish the JavaScript version of all of our source code rather than
the typescript version.
If we were to publish just the typescript version of all of our source code.
Well, then we're really assuming that anyone, anyone else who's going to make use of our package is
also making use of typescript, which might not be true.
So, again, we just need to make sure we take the typescript and transport it into a JavaScript as
far as the purpose of this package or what it's going to actually do.
All I want to do inside, if you're all we are going to write inside this index, not file, we're going
to start up a very small express server listening on PT. three thousand five.
We might set up one or two little event handlers on it, but not superimportant.
OK, so let's go back over to our terminal and get started on this very small project.
Back at my terminal, I'm going to change out of our book project directory.
I'm back inside of a workspace directory of sorts.
Here are all the different subprojects we've worked on throughout this course inside of here.
I'm going to create a new folder and I will call it tiny NPM Deploy.
Well, then change into that directory and then once inside there, I'll generate a new package, JSON
file with NPM Dashi.
Once we've generated that file, we can then start to install a couple of different dependencies, so
we definitely need to make use of typescript.
Let's get that and we'll definitely also need Xpress install that as well.
The versions that we use of these two packages doesn't matter.
Can get any version you like.
And once those are installed, we will open up our code editor inside this directory.
And we'll start adding in a couple of different things inside of our package that Jason file and generate
a couple of different files and folders.
First, I'm going to create a new folder called SAAC.
Inside there, I'll make a new file called Index Dots.
So right away, let's just go ahead and read our express server again, we're just going to listen to
board three thousand five and this is just to have some code inside of here that makes use of some outside
library.
So it's not really important what this does.
I just want to try to create it and express server.
That's pretty much it at the top.
I will import Express from Express.
I'll then create my app.
I'll add on one event listener or one handler of just on fine.
I'll receive broken ribs and I'll do a resort send off hi there.
And then finally, an app that listen.
On three thousand five.
And inside the callback function will say listening.
On three thousand and five.
You might notice that we are getting a little kind of warning or two here, you might have even seen
an air entirely.
That's just because we did not install the type definition files for Express.
Let's just do that very quickly back at our terminal.
The back over here, I'll do an install at Type's Express as well.
And now those warnings should go away very quickly.
OK, looks good.
All right, so this is a good start.
Let's take a pause here.
When we come back, the next video, we're going to do a little bit of typescript setup, make sure
we generate that config file and set up a build script as well.