DEV Community

vishal patidar
vishal patidar

Posted on

1

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

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay