Explain me NPM in simple terms
Table Of Contents
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 🚀