What is NPM?

    Jan 26, 2022       by Suraj Roy

npm (short for Node Package Manager) is a package manager for JavaScript programming language. It is the default package manager for the JavaScript runtime environment Node.js. npm allows developers to share and reuse code by making packages of JavaScript code available for others to use and build upon. It makes it easy for developers to install and manage libraries, frameworks, and other dependencies for their projects.

npm is typically used to manage dependencies for Node.js projects, but can also be used for client-side JavaScript projects. It includes a command-line interface (CLI) that can be used to easily download and manage packages and dependencies, as well as to automate common development tasks. Developers can use npm to install and manage packages and dependencies, as well as to publish their own packages.

Additionally, npm has a public registry of packages that can be used by developers, and npm can be used to easily download, install, and update packages from the registry. npm is one of the most popular package manager and has a vast ecosystem of open-source libraries and packages that can be utilized to accelerate the development process.

Installing Modules using NPM

Syntax to install any NPM package:

npm install <Module Name>

 

For Example, We have to install express web framework module:

npm install express

 

To uninstall the package, We follow the command:

npm uninstall express

 

The installed module can be used using below code:

const express = require('express');

 

Updating a Module:

npm update express

 

And Search a Module using the below code:

npm search express

 

 

 

 

 


WHAT'S NEW

Find other similar Articles here: