1
00:00:00,270 --> 00:00:05,750
Welcome back in this lesson I'm going to focus around introducing something called an PM.

2
00:00:05,820 --> 00:00:07,730
So I have three main objectives here.

3
00:00:08,070 --> 00:00:11,990
First one I want to do is define what NPM is what it stands for.

4
00:00:12,090 --> 00:00:16,500
Conceptually what it does and then explain why it's awesome.

5
00:00:16,500 --> 00:00:20,150
And then lastly intro all the packages that will end up using.

6
00:00:20,190 --> 00:00:25,710
So that will make more sense once we define what are packages in the intro to node video I showed the

7
00:00:25,720 --> 00:00:32,670
notorious home page and I read this little paragraph and it talks about how I notice a javascript runtime

8
00:00:32,670 --> 00:00:36,130
built on Chromes V8 engine blah blah blah blah blah.

9
00:00:36,330 --> 00:00:38,450
And then there's this sentence here.

10
00:00:38,730 --> 00:00:45,800
No Julius's package ecosystem NPM is the largest ecosystem of open source libraries in the world.

11
00:00:46,140 --> 00:00:49,580
I think it's telling that on the official No just home page.

12
00:00:49,800 --> 00:00:56,370
One third of this little blurb just one sentence but it's still one third is about NPM.

13
00:00:56,370 --> 00:01:03,060
Also when I first introduced Noad I showed the stack share page for it and we went over some of these

14
00:01:03,060 --> 00:01:07,420
features that users have voted on being the best parts of no.

15
00:01:07,450 --> 00:01:08,030
Yes.

16
00:01:08,340 --> 00:01:12,180
And the most popular answer here is great libraries.

17
00:01:12,390 --> 00:01:14,900
And the second most popular is NPM.

18
00:01:15,120 --> 00:01:17,800
And really these are referring to the exact same thing.

19
00:01:17,850 --> 00:01:21,510
Hopefully I've convinced you that nvm is important.

20
00:01:21,510 --> 00:01:25,510
Now let's talk about why and talk about what it is and how it works.

21
00:01:25,530 --> 00:01:32,610
So on the NPM home page here just closed this little blurb can see the official slogan NPM is the package

22
00:01:32,610 --> 00:01:34,700
manager for Javascript.

23
00:01:35,190 --> 00:01:39,740
So let's talk about what a package is when we write front and Javascript.

24
00:01:39,750 --> 00:01:44,150
Think back to creating an HD mail file and then including things with a script tag.

25
00:01:44,460 --> 00:01:50,520
And if we wanted to include something like Jay query or the bootstrap javascript library or any other

26
00:01:50,520 --> 00:01:54,320
javascript library we need to use a script tag in our team.

27
00:01:54,690 --> 00:01:59,610
But if we're writing node on the server side and we want to include a library or something that someone

28
00:01:59,610 --> 00:02:04,920
else wrote We can't just add a script tag because there are no script tags because there's no H.T. amount

29
00:02:04,930 --> 00:02:05,180
.

30
00:02:05,370 --> 00:02:10,680
We're just dealing with Node the way that we get those libraries when we're writing server side javascript

31
00:02:10,680 --> 00:02:17,250
to run or writing node is through NPM rather than calling them libraries and Pim refers to them as packages

32
00:02:17,270 --> 00:02:17,400
.

33
00:02:17,550 --> 00:02:18,720
But it's the same idea.

34
00:02:18,840 --> 00:02:21,960
So packages are just code that someone else has written.

35
00:02:22,010 --> 00:02:27,690
A group has written a single person has written that we can include an add to our own project and what

36
00:02:27,690 --> 00:02:33,600
makes it even more exciting to me compared to including a front end libraries like Jay queery or bootstrap

37
00:02:34,080 --> 00:02:41,010
is that all the packages are centralized here on this NPM Web site and more importantly NPM has a command

38
00:02:41,010 --> 00:02:44,380
line tool so I can install things really really easily.

39
00:02:44,550 --> 00:02:50,830
I wanted to install a package like Express or or goal for forever whatever these are.

40
00:02:51,000 --> 00:02:57,250
All I have to do is type NPM install and the name of the package in my command line and that's it.

41
00:02:57,270 --> 00:03:01,330
I don't have to go and find a Cdn or a link and copy and paste something.

42
00:03:01,380 --> 00:03:04,890
All I have to do is run NPM install and then the name of the package.

43
00:03:05,070 --> 00:03:10,950
And as long as NPM knows about that package and you can see there's almost 200000 different packages

44
00:03:10,950 --> 00:03:11,280
.

45
00:03:11,360 --> 00:03:15,900
It will automatically be installed for me in the next video will actually do that and install some new

46
00:03:15,900 --> 00:03:20,530
packages and important them in and use some really simple packages to start.

47
00:03:20,880 --> 00:03:26,610
But as we progress through this course we're going to continually use and add in new packages when people

48
00:03:26,610 --> 00:03:29,640
create web applications using knode.

49
00:03:29,670 --> 00:03:32,930
They don't just write plain javascript and do everything from scratch.

50
00:03:33,000 --> 00:03:37,620
For the most part you're going to use packages and other tools frameworks things that other people have

51
00:03:37,620 --> 00:03:40,080
written to make our life easier.

52
00:03:40,080 --> 00:03:44,220
In our stack we'll be using a package called Express which you can see here.

53
00:03:44,280 --> 00:03:45,930
This one is really popular.

54
00:03:45,990 --> 00:03:49,090
We'll also be using another package called mongoose.

55
00:03:49,190 --> 00:03:50,810
And actually they can show you here.

56
00:03:50,880 --> 00:03:56,190
We're using a few different packages when called body parts or another called Morgon another called

57
00:03:56,220 --> 00:03:57,240
Ejay ass.

58
00:03:57,360 --> 00:04:02,280
And there are even more that we will eventually introduce will be working with about 10 different packages

59
00:04:02,280 --> 00:04:03,200
that we've installed.

60
00:04:03,300 --> 00:04:04,830
By the end of this course.

61
00:04:05,880 --> 00:04:09,500
Let me go back to the objectives and wrap up.

62
00:04:09,540 --> 00:04:10,780
So define NPM.

63
00:04:10,830 --> 00:04:16,620
We talked about what it stands for node package manager and it's this awesome tool that comes with node

64
00:04:16,980 --> 00:04:23,910
that lets us install packages which are just the javascript version or the the node version of libraries

65
00:04:24,060 --> 00:04:29,910
just code that someone else wrote that makes our life easier and NPM lets us install them really really

66
00:04:29,910 --> 00:04:30,630
easily.

67
00:04:30,840 --> 00:04:34,140
So thats one of the reasons why its awesome it's easy to use.

68
00:04:34,140 --> 00:04:39,920
Also it's this centralized repository of almost 200000 different packages.

69
00:04:39,990 --> 00:04:45,000
Pretty much everything you want to do any possible thing whether it's printing out pictures of cats

70
00:04:45,060 --> 00:04:50,820
or setting up a web application or connecting to a database or printing out colorful text in your terminal

71
00:04:50,820 --> 00:04:55,850
or telling a knock knock joke almost anything you could imagine doing with javascript and node.

72
00:04:55,950 --> 00:05:01,050
Someone has already done it and packaged it into this nice module into a package that you can install

73
00:05:01,560 --> 00:05:06,360
and then I very briefly introduced a few of the packages that will end up using the most important one

74
00:05:06,360 --> 00:05:10,250
by far is called Express and that will be our framework that we use.

75
00:05:10,620 --> 00:05:18,030
But we'll also use things like mongoose and Morgan and Ejay ass and body parser and cookie parser and

76
00:05:18,030 --> 00:05:20,970
passport and a few other ones as well.

77
00:05:21,070 --> 00:05:26,340
And the next video we're going to see how we can install packages using the awesome command line interface

78
00:05:26,340 --> 00:05:31,290
that I mentioned and then also how we can use those packages that we've installed instead of her own

79
00:05:31,290 --> 00:05:32,110
javascript code
