Welcome back in this lesson I'm going to focus around introducing something called an PM.
So I have three main objectives here.
First one I want to do is define what NPM is what it stands for.
Conceptually what it does and then explain why it's awesome.
And then lastly intro all the packages that will end up using.
So that will make more sense once we define what are packages in the intro to node video I showed the
notorious home page and I read this little paragraph and it talks about how I notice a javascript runtime
built on Chromes V8 engine blah blah blah blah blah.
And then there's this sentence here.
No Julius's package ecosystem NPM is the largest ecosystem of open source libraries in the world.
I think it's telling that on the official No just home page.
One third of this little blurb just one sentence but it's still one third is about NPM.
Also when I first introduced Noad I showed the stack share page for it and we went over some of these
features that users have voted on being the best parts of no.
Yes.
And the most popular answer here is great libraries.
And the second most popular is NPM.
And really these are referring to the exact same thing.
Hopefully I've convinced you that nvm is important.
Now let's talk about why and talk about what it is and how it works.
So on the NPM home page here just closed this little blurb can see the official slogan NPM is the package
manager for Javascript.
So let's talk about what a package is when we write front and Javascript.
Think back to creating an HD mail file and then including things with a script tag.
And if we wanted to include something like Jay query or the bootstrap javascript library or any other
javascript library we need to use a script tag in our team.
But if we're writing node on the server side and we want to include a library or something that someone
else wrote We can't just add a script tag because there are no script tags because there's no H.T. amount
.
We're just dealing with Node the way that we get those libraries when we're writing server side javascript
to run or writing node is through NPM rather than calling them libraries and Pim refers to them as packages
.
But it's the same idea.
So packages are just code that someone else has written.
A group has written a single person has written that we can include an add to our own project and what
makes it even more exciting to me compared to including a front end libraries like Jay queery or bootstrap
is that all the packages are centralized here on this NPM Web site and more importantly NPM has a command
line tool so I can install things really really easily.
I wanted to install a package like Express or or goal for forever whatever these are.
All I have to do is type NPM install and the name of the package in my command line and that's it.
I don't have to go and find a Cdn or a link and copy and paste something.
All I have to do is run NPM install and then the name of the package.
And as long as NPM knows about that package and you can see there's almost 200000 different packages
.
It will automatically be installed for me in the next video will actually do that and install some new
packages and important them in and use some really simple packages to start.
But as we progress through this course we're going to continually use and add in new packages when people
create web applications using knode.
They don't just write plain javascript and do everything from scratch.
For the most part you're going to use packages and other tools frameworks things that other people have
written to make our life easier.
In our stack we'll be using a package called Express which you can see here.
This one is really popular.
We'll also be using another package called mongoose.
And actually they can show you here.
We're using a few different packages when called body parts or another called Morgon another called
Ejay ass.
And there are even more that we will eventually introduce will be working with about 10 different packages
that we've installed.
By the end of this course.
Let me go back to the objectives and wrap up.
So define NPM.
We talked about what it stands for node package manager and it's this awesome tool that comes with node
that lets us install packages which are just the javascript version or the the node version of libraries
just code that someone else wrote that makes our life easier and NPM lets us install them really really
easily.
So thats one of the reasons why its awesome it's easy to use.
Also it's this centralized repository of almost 200000 different packages.
Pretty much everything you want to do any possible thing whether it's printing out pictures of cats
or setting up a web application or connecting to a database or printing out colorful text in your terminal
or telling a knock knock joke almost anything you could imagine doing with javascript and node.
Someone has already done it and packaged it into this nice module into a package that you can install
and then I very briefly introduced a few of the packages that will end up using the most important one
by far is called Express and that will be our framework that we use.
But we'll also use things like mongoose and Morgan and Ejay ass and body parser and cookie parser and
passport and a few other ones as well.
And the next video we're going to see how we can install packages using the awesome command line interface
that I mentioned and then also how we can use those packages that we've installed instead of her own
javascript code