Node Package Manager

All you need to know about NPM

Parwin Akhtari
3 min readMar 15, 2021

In layman’s language NPM is a warehouse of large amount of code packages. It is the world’s largest software collection. The registry contains over 800,000 code packages.

NPM is used all over the world by Open source developers to share and borrow packages, and many organizations use it to manage private development as well.

NPM is free to use: You can download all npm public software packages without any registration.

NPM basically consists of three distinct components:

1. the website

2. the Command Line Interface (CLI)

3. the registry

The website

The NPM Website is used to discover packages, set up profiles, and manage other aspects of your npm experience like many organizations use npm to manage private development or manage access to public or private.

The Command Line Interface (CLI)

CLI is a command line program that accepts text input to execute operating system functions. NPM includes a CLI (Command Line Client).

CLI is where most developers interact with npm. By giving command in CLI you can download and install software. Example of command given in windows:

C:\>npm install <package_name>

The Registry

Registry is a large public database of JavaScript. To resolve packages by name and version, npm talks to a registry website that implements the CommonJS Package Registry specification for reading package info.

How to install NPM

NPM gets installed along with Node.js . To download node.js you can visit the official Node.js web site

Managing Dependencies

NPM can (in one command line) install all the dependencies of any project. if we give a command like:

npm install <module>

In the above command, replace <module> with the name of the module you want to install. For example, if you want to install material-ui icons(React js ui framework), you could run the following command:

npm install @material-ui/icons

Having dependencies in your project’s package.json allows the project to install the versions of the modules it depends on.

A package. json is a JSON file that exists at the root of a Javascript/Node project. It holds metadata relevant to the project and it is used for managing the project’s dependencies, scripts, version and a whole lot more stuffs. Here the key is the name of the package and the value is the version of the package to be used.

By running an install command inside of a project, you can install all of the dependencies that are listed in the project's package.json .

Wait for what then?? Easily Install various public modules or packages you want to use in your project through npm and dive into the world of coding.

--

--

Parwin Akhtari

Student at NIT Rourkela || Web developer || UI-UX Designer