1
00:00:01,170 --> 00:00:04,950
Let's get some more details on what this tiny NPM diploid package is going to do.

2
00:00:05,250 --> 00:00:09,360
So, again, it's just for practice on deploying off to NPM because like I said, there are going to

3
00:00:09,360 --> 00:00:15,060
be some very small issues we run into once we start deploying all three of our packages inside of a

4
00:00:15,060 --> 00:00:19,540
tiny NPM deploy, we're going to write out a single typescript file called Indexed US.

5
00:00:19,980 --> 00:00:24,180
At some point in time, we're going to run that file through the typescript compiler and then produce

6
00:00:24,180 --> 00:00:25,560
an index file.

7
00:00:26,160 --> 00:00:30,960
Now, it is really this indexed JS file that we want to deploy off to NPM in general.

8
00:00:30,960 --> 00:00:35,730
Whenever we publish a package, we publish the JavaScript version of all of our source code rather than

9
00:00:35,730 --> 00:00:36,750
the typescript version.

10
00:00:37,080 --> 00:00:39,960
If we were to publish just the typescript version of all of our source code.

11
00:00:40,200 --> 00:00:44,130
Well, then we're really assuming that anyone, anyone else who's going to make use of our package is

12
00:00:44,130 --> 00:00:46,650
also making use of typescript, which might not be true.

13
00:00:47,510 --> 00:00:53,300
So, again, we just need to make sure we take the typescript and transport it into a JavaScript as

14
00:00:53,300 --> 00:00:56,030
far as the purpose of this package or what it's going to actually do.

15
00:00:56,360 --> 00:01:00,500
All I want to do inside, if you're all we are going to write inside this index, not file, we're going

16
00:01:00,500 --> 00:01:04,190
to start up a very small express server listening on PT. three thousand five.

17
00:01:04,560 --> 00:01:08,480
We might set up one or two little event handlers on it, but not superimportant.

18
00:01:09,520 --> 00:01:12,940
OK, so let's go back over to our terminal and get started on this very small project.

19
00:01:15,810 --> 00:01:19,110
Back at my terminal, I'm going to change out of our book project directory.

20
00:01:19,550 --> 00:01:22,050
I'm back inside of a workspace directory of sorts.

21
00:01:22,360 --> 00:01:26,800
Here are all the different subprojects we've worked on throughout this course inside of here.

22
00:01:26,850 --> 00:01:32,230
I'm going to create a new folder and I will call it tiny NPM Deploy.

23
00:01:33,550 --> 00:01:38,830
Well, then change into that directory and then once inside there, I'll generate a new package, JSON

24
00:01:38,830 --> 00:01:41,050
file with NPM Dashi.

25
00:01:44,360 --> 00:01:48,680
Once we've generated that file, we can then start to install a couple of different dependencies, so

26
00:01:48,680 --> 00:01:51,200
we definitely need to make use of typescript.

27
00:01:51,410 --> 00:01:55,850
Let's get that and we'll definitely also need Xpress install that as well.

28
00:01:56,380 --> 00:01:58,810
The versions that we use of these two packages doesn't matter.

29
00:01:58,870 --> 00:02:00,050
Can get any version you like.

30
00:02:02,360 --> 00:02:06,500
And once those are installed, we will open up our code editor inside this directory.

31
00:02:09,680 --> 00:02:14,390
And we'll start adding in a couple of different things inside of our package that Jason file and generate

32
00:02:14,390 --> 00:02:15,830
a couple of different files and folders.

33
00:02:16,580 --> 00:02:19,610
First, I'm going to create a new folder called SAAC.

34
00:02:20,730 --> 00:02:24,000
Inside there, I'll make a new file called Index Dots.

35
00:02:25,210 --> 00:02:29,530
So right away, let's just go ahead and read our express server again, we're just going to listen to

36
00:02:29,680 --> 00:02:35,140
board three thousand five and this is just to have some code inside of here that makes use of some outside

37
00:02:35,140 --> 00:02:35,590
library.

38
00:02:35,860 --> 00:02:37,410
So it's not really important what this does.

39
00:02:37,420 --> 00:02:39,370
I just want to try to create it and express server.

40
00:02:39,370 --> 00:02:41,310
That's pretty much it at the top.

41
00:02:41,320 --> 00:02:44,110
I will import Express from Express.

42
00:02:45,430 --> 00:02:46,900
I'll then create my app.

43
00:02:49,390 --> 00:02:55,810
I'll add on one event listener or one handler of just on fine.

44
00:02:56,890 --> 00:03:01,270
I'll receive broken ribs and I'll do a resort send off hi there.

45
00:03:03,450 --> 00:03:05,160
And then finally, an app that listen.

46
00:03:06,160 --> 00:03:07,570
On three thousand five.

47
00:03:09,630 --> 00:03:12,000
And inside the callback function will say listening.

48
00:03:12,890 --> 00:03:15,050
On three thousand and five.

49
00:03:16,050 --> 00:03:19,770
You might notice that we are getting a little kind of warning or two here, you might have even seen

50
00:03:19,770 --> 00:03:20,700
an air entirely.

51
00:03:21,000 --> 00:03:24,060
That's just because we did not install the type definition files for Express.

52
00:03:24,430 --> 00:03:26,160
Let's just do that very quickly back at our terminal.

53
00:03:27,800 --> 00:03:32,770
The back over here, I'll do an install at Type's Express as well.

54
00:03:35,680 --> 00:03:37,720
And now those warnings should go away very quickly.

55
00:03:38,230 --> 00:03:38,950
OK, looks good.

56
00:03:39,780 --> 00:03:41,190
All right, so this is a good start.

57
00:03:41,580 --> 00:03:42,600
Let's take a pause here.

58
00:03:42,600 --> 00:03:45,960
When we come back, the next video, we're going to do a little bit of typescript setup, make sure

59
00:03:45,960 --> 00:03:49,640
we generate that config file and set up a build script as well.

