DEV Community

vishal patidar
vishal patidar

Posted on

What is the NPM | How It's work?

What is NPM?

NPM stand for node package manager. It is Node.js package manager which is used to download JavaScript module in any JavaScript project.

What is the need of NPM?

The main advantage of NPM is to be more productive your work.
For e.g. any developer create a module which is use to fetch data by calling API and developer create a method fetch(). Developer write all code to call API you just have to install the node package and call the fetch() function and pass the API end point URL as a parameter.

If you not install the node package manager so you have to write code from start so without wasting time you can use other developer created modules to build project in less time.

NPM-working-image

How we can use NPM package in JavaScript Project?

As we know that NPM is a command line tool so there is some command which is use to install and publish node package on the NPM package manager.

For example we want to install axios package which is use to call API.

 npm install package-name
Enter fullscreen mode Exit fullscreen mode

Install axios in React project.

 npm install axios
Enter fullscreen mode Exit fullscreen mode

Top comments (0)