Node.js Package Manager



NodeJS Package Manager:

NPM or Node.js Package Manager manages the Node.js packages, which contains the files a user needs for a module. The NPM program is installed with Node.js installable automatically.

Downloading and Installing Modules using npm:

  • Open the command line interface.
  • Type Command npm install <Module Name>.

 Example:

npm install upper-case

To include a Package:

Like any other module, a package is used the same way, i.e, Node.js require() function with the name of the module is used.

 

Syntax:

var variable_name = require(‘module_name’);

Local Installation of Packages:

 

By default, NPM creates a directory named “node_modules” in the current directory. All the installed packages are placed in this folder. This whole process is termed as local installation of packages.

Global Installation of Packages:

NPM places all the Globally installed packages in the system directory. For global installation of packages

  • Open Node.js command prompt.
  • Type Command npm install -g <Module Name>.

Example:

npm install -g upper-case

Here first line tells about the module version and its location where it is getting installed.

Uninstalling Modules using npm:

 Open the command line interface.

  • Type Command npm uninstall <Module Name>.

 Example:

npm uninstall upper-case

 

NodeJS Interview Questions

 

Tags: ,
Leave a comment

Your email address will not be published. Required fields are marked *

Subscribe now

Receive weekly newsletter with educational materials, new courses, most popular posts, popular books and much more!

https://bridgejunks.com/ https://crownmakesense.com/ https://brithaniabookjudges.com/ https://hughesroyality.com/ https://rhythmholic.com/ https://bandar89.simnasfikpunhas.com/ https://www.100calshop.co.il/products/thailand/ https://myasociados.com/ https://solyser.com/ http://konfidence.cz/ https://muscadinepdx.com/ https://bandar89.parajesandinos.com.ve/ https://goremekoop.com/ https://oncoswisscenter.com/ https://www.turunclifehotel.com/bandar89/ https://www.houseofproducts.biz/ https://taimoormphotography.com/
BIJI18 BIJI18 BIJI18