Jonas: So now that you know the
absolute fundamentals of Node.JS.,
let's take the rest of the section
to talk a little bit about npm,
so the node package manager.
So the node package manager is a command line
interface app that automatically comes
included with Node JS
in which we use to install and manage
Open Source packages.
Now these packages that I just mentioned,
they usually come from the package repository
that is also npm.
So at npm.js, you can take a look
at all the modules or packages
that are included in the npm repository.
So npm is actually both the command line interface app
that we use to manage the packages
and also the repository itself.
And actually, it's the largest software
registry in the world,
no matter what language we're talking about.
And by the time of this recording,
it has about 800,000 packages.
So sometime, in the near future
it will probably have over a million packages
here on npm.
So, let's for example, search for express,
which is the node framework that we're going to use
throughout most of the rest of the course.
And so, for example,
you can then click on it,
and here you have all the information
about each of the modules.
So you can see that, for example,
this one is download almost eight million times
in the last week.
So you see that it's a hugely popular package.
Then, here, usually you have some documentation.
But for now, that doesn't really matter.
So for now, we're just interested in what npm actually is.
Probably, you have used npm, yourself,
before when working on front-end development.
Because these days, npm is actually not just used
for node development,
but really across the entire Java's stack.
So, for example, if you'll search for react,
it's also gonna be here.
So really, all these popular libraries
and frameworks,
they are all really on the npm registry.
Basically, npmjs.com is where all these packages are hosted.
Now, about the command line interface, itself,
it actually comes already pre-installed with NodeJS.
So, let's now actually start using it,
and go back to our project.
So here we have still our terminal open,
but I'm gonna quit now this process here,
so I hit control c and then clear the terminal.
Npm is a software that we basically use to manage
the third party Open Source packages that
we choose to include and use in our project.
And the first thing that they usually do
whenever we start a new project,
is to start with npm init.
So we use npm as the command and then init.
And this will basically create a package.jason file.
Which is kind of a configuration file of our project
where all kinds of data about the project is stored.
We're gonna see more about that once that is finished.
So npm init is now asking us a bunch of questions
as you see down here.
And, maybe, if you're not seeing it,
I will increase this a bit.
So, first thing that we need to specify
is the package name.
And this one is called node farm.
So we need to use a url friendly name here,
so that's why I have the hyphen.
And what you see here is the suggested name,
but I don't want the one in there,
so I just retype node farm here.
Then we have the version,
so we can just hit return here on this one.
And in the description, learning node js.
The entry point is the next.js,
but again, this doesn't really matter.
We don't have any test command,
so just hit return again.
Now we'll get keywords,
doesn't really matter again.
The author is me.
You can put your own name, of course,
and license and so,
one that's okay, to confirm that this is the file
that we want.
Actually, it created it right away here on this left side.
Bring it down again here.
So, indeed, this is our package Jason file,
with this very basic information
about the project for now.
But there is a lot of stuff that can be added
to this file and we will do so later in another project.
Also, right in the next video which is where we're gonna
installing packages.
And these packages are then also registered here
in this file so that we can keep tract of all the packages
that we're actually using.
So, in our next video we're then going to finally install
some real packages here.