DEV Community

Cover image for NPM:Node Package Manager
Srushti Kulkarni
Srushti Kulkarni

Posted on

NPM:Node Package Manager

Hello All, Let's talk about the NPM. The people who are working on JavaScript, ReactJs, NodeJs might be familiar with NPM. so basically NPM is package manager used in JavaScript to manage the libraries, dependencies and projects.

First of all *whats the NPM? * As per title we can say , npm is abbrevation for Node Package Manager which manages the package or we can say that it is a standard repository for all the pacakages.

For building an application from scrtach, first of all we have to write the command which is
NPM init Command

It setup the foundation for NodeJs project. It tracks the project dependency and script. Whenver we run command npm init it asks about the package name, version, description, entry point, license, author etc. From this information it creates package.json file which contains the whole information about the application in the JSON format(key-value)pair.

It looks like this:
Image description

When we want to install some packages we use the command npm install package name. So here we are installing express package.

Image description

After installing this package, it wraps up express package inside node modules.The node module stores all the packages which we install.

Image description
Node modules contains actual data dependencies[data which is used for project].Inside of node modules all the packages are going to store.I've installed the express package and it goes inside the node modules and it looks like this

Image description

Whenever we install the packages, inside the package.json file it generates dependencies and all the dependencies are present inside the dependencies with their current version.

Image description

Package.lock.json : It tracks all the exact version of all the dependenies.

Image description

NPM : Installing the Package.
NPX : Executing the Package.

So this is about the NPM.

Top comments (0)