1
00:00:00,150 --> 00:00:04,900
Awesome, we're familiar with and I'm more familiar with package, Jason.

2
00:00:05,400 --> 00:00:12,240
Now, let's finally install the dependency that we'll use for the remainder of the course, and that

3
00:00:12,240 --> 00:00:14,690
is no other than the Noton.

4
00:00:15,060 --> 00:00:21,180
And of course, if you want to get more info, you can visit the NPRM and you can search for the package.

5
00:00:21,390 --> 00:00:29,670
But as far as the general setup is just going to watch our files and then restart our app for us so

6
00:00:29,670 --> 00:00:36,510
that we don't have to each and every time type node and then whatever the file name.

7
00:00:37,020 --> 00:00:43,530
And we can install it as a simple dependency, not as definitely an option, but since I also would

8
00:00:43,530 --> 00:00:50,790
want to cover the dependencies, will install that as a dev dependency and command for dev dependencies

9
00:00:50,790 --> 00:00:58,730
is following where we go with NPM and then I or install whatever, and then we go with Node Month.

10
00:00:58,740 --> 00:01:02,850
So that is a package name and then you can either do hyphen deep.

11
00:01:03,570 --> 00:01:09,570
So that just signals that that is a dependency or you'll see this save.

12
00:01:09,760 --> 00:01:15,300
And so again, whichever method you choose, that is really up to you.

13
00:01:15,600 --> 00:01:19,890
But just remember that both of them will serve it as a dependency.

14
00:01:20,130 --> 00:01:22,440
So let's install it and then I'll talk about it.

15
00:01:22,730 --> 00:01:25,550
Why we would want to set up as a dependency.

16
00:01:25,980 --> 00:01:31,700
And the reason for that is because if we think about it, do we really need node Gnomon in production?

17
00:01:32,400 --> 00:01:33,410
And the answer is no.

18
00:01:33,420 --> 00:01:39,870
When we push it up to Digital Ocean or Herock or whatever, we'll of course use something more serious

19
00:01:39,870 --> 00:01:44,310
than Node to restart our application RPM to comes to mind.

20
00:01:44,760 --> 00:01:47,750
But while we're developing, yeah, that is an option.

21
00:01:48,210 --> 00:01:53,000
So in this case we're at the right away node man to the dev dependencies.

22
00:01:53,370 --> 00:01:59,220
Now what else, what kind of packages we would add to their dependencies, for example, testing packages,

23
00:01:59,460 --> 00:02:04,290
for example, lintang for example for mining and that sort of thing.

24
00:02:04,360 --> 00:02:04,890
Got nothing.

25
00:02:04,890 --> 00:02:07,800
Stops you from jamming this Independence's.

26
00:02:08,220 --> 00:02:14,160
But if you think about it, it makes way more sense if we have this as dev dependency.

27
00:02:14,250 --> 00:02:17,160
So we use it while we are creating the app.

28
00:02:17,490 --> 00:02:24,150
But then once it's in production, then we just share the dependencies that actually the app is using,

29
00:02:24,450 --> 00:02:27,720
not the ones that we used while we developed the app.

30
00:02:27,990 --> 00:02:32,550
Hopefully that is clear and once we have the package, we're almost there.

31
00:02:32,850 --> 00:02:37,560
Now we just need to understand how the scripts work in a package.

32
00:02:37,570 --> 00:02:40,470
Drayson At the moment, as you can see, we have the test one.

33
00:02:40,470 --> 00:02:44,040
We won't use that one inside of the script object.

34
00:02:44,280 --> 00:02:46,050
We just set up the commands.

35
00:02:46,380 --> 00:02:52,260
And as a side note, we can set up the command right now, even without the Nordman, for example,

36
00:02:52,260 --> 00:03:01,470
I could go with start and that command will be equal to and PM and or I'm sorry, node and then, for

37
00:03:01,470 --> 00:03:02,520
example, Abcess.

38
00:03:02,880 --> 00:03:04,470
So that is my command.

39
00:03:04,740 --> 00:03:12,870
And once I save my package JSON, instead of running this node abcess, I can simply run and rpm and

40
00:03:12,870 --> 00:03:14,290
start amatus.

41
00:03:14,310 --> 00:03:16,620
As you can see, the same functionality.

42
00:03:16,950 --> 00:03:22,910
I run objets and I get back the array as well as the whole world again.

43
00:03:22,920 --> 00:03:24,540
We still exit the application.

44
00:03:24,900 --> 00:03:26,700
So it's not like we're out of the woods.

45
00:03:26,700 --> 00:03:31,650
But I'm just showcasing that, yes, we can set up the commands and land in the command.

46
00:03:31,650 --> 00:03:33,000
We just provide a value.

47
00:03:33,240 --> 00:03:37,170
And in this case, of course, it is node and abcess.

48
00:03:37,500 --> 00:03:44,760
Now for some commands you can simply type npm start, as you can see, but for some of them, you'll

49
00:03:44,760 --> 00:03:51,150
have to provide full value and that is going to be npm run and not chokers that I'm going to go with

50
00:03:51,150 --> 00:03:53,610
Dev and that one will be equal.

51
00:03:53,850 --> 00:03:59,280
And in here we're going to go with a node Mond and Abidjan's.

52
00:03:59,610 --> 00:04:06,300
So instead of running node like we're doing in the start now, I'm setting up a dev command and in order

53
00:04:06,300 --> 00:04:12,360
to run this one, I'll have to go with NPM Run and then whatever it is, the command line again, some

54
00:04:12,360 --> 00:04:16,950
of them you'll be able to use the shortcut where you go start and some of them you'll have to go the

55
00:04:16,950 --> 00:04:20,940
full out with NPM run and then whatever is the command.

56
00:04:20,940 --> 00:04:24,750
And as a sign of yes, you can still run, npm, run, start.

57
00:04:25,470 --> 00:04:27,840
This is also going to invoke the command, but.

58
00:04:28,630 --> 00:04:37,090
In our case, we have Deve and in here I have no name on an app jash, so let's try it out.

59
00:04:37,310 --> 00:04:43,420
Let's say first the package, Jason, and you should notice something pretty cool where if I go with

60
00:04:43,420 --> 00:04:53,890
AMPM run and now I'm spinning up the one and it tells me that no man is watching my application.

61
00:04:54,580 --> 00:05:01,780
And since I know that of course we can test it out where I'm going to go with console log and then instead

62
00:05:01,780 --> 00:05:06,400
of the the world which I have after new items, we're going to go with hello people.

63
00:05:06,760 --> 00:05:11,740
And you should see something interesting where once I change the text.

64
00:05:12,040 --> 00:05:12,310
Yep.

65
00:05:12,610 --> 00:05:14,140
Node one restarts.

66
00:05:15,090 --> 00:05:18,720
My app and of course, my values will people awesome.

67
00:05:19,050 --> 00:05:27,930
So now I don't have to type every time the node and then whatever, Philmont Norman automatically just

68
00:05:27,930 --> 00:05:32,610
restarts my app and I simply set it up as a script.

69
00:05:32,970 --> 00:05:38,730
Now, if you want to turn this around, if you don't want to run and around Dev, you can simply say

70
00:05:38,730 --> 00:05:42,660
Gnomon and then objets and just remove the dev.

71
00:05:42,660 --> 00:05:49,230
One completely unnecessary note, again, if you have worked with React Project, you are familiar with

72
00:05:49,230 --> 00:05:56,040
the setup because for react again we run ampm start and then there is a value that spins up the whole

73
00:05:56,250 --> 00:05:59,760
react dev server where we can see our application.

