DEV Community

Cover image for Explain me NPM in simple terms
Rahul
Rahul

Posted on • Edited on • Originally published at rahulism.tech

Explain me NPM in simple terms

NPM stands for Node Package Manager and is composed of an online repository of open-source Node.js projects and a command-line utility used to interact with this repository.

The power of package manager is that they are specially structured to easily provide code, libraries and entire frameworks.

Just a Play Store for your projects.


Let's assume that you are creating an APP that will upset the world but you run into a problem and find a magic library that solves it efficiently. You just have to type: npm install "magic library".

NPM is like a Play Store

Let's assume you need a navigator on your phone. Do you need to create an application from scratch? Of course not! You will open the play store and download it(choosing the one you like the best)

NPM works in much the same way: when you need to implement a feature in your project you can download (install) the associated code package and use it.


What happens if I download a lot of Apps?

the phone begs you to stop. LOL.
NPM has you covered.

A specific file called package.json keeps track of all the packages you install and manages their dependencies. This makes it easy to keep the packages updated and even easier to share the project (on got for example).

Package are not physically and shared but only a "link" to them, in this way the project will weigh little and those who want to use it can install the packages listed in "package.json" by typing the command "npm install".

THANKS FOR READING 🚀


Removal.AI - [SPONSOR]

Remove background from multiple images in a single upload straight to your desktop using Bulk Photo Background Remover for Windows.

  • ✅ Drag & Drop Multiple Images
  • ✅ Optimize Product Images
  • ✅ Select Your Background
  • ✅ Set Your Output Size
  • ✅ Exceptional Results

Visit -> Removal AI

Top comments (3)

Collapse
 
atulcodex profile image
🚩 Atul Prajapati 🇮🇳

Short and simple explanation, do you know how to update this Npm libraries in existing projects?

Collapse
 
rahxuls profile image
Rahul

In CMD you can open your project folder and then you can run in the root directory npm update. This should solve the problem.

Collapse
 
atulcodex profile image
🚩 Atul Prajapati 🇮🇳

Cool too easy, thanks!