Thursday, August 24, 2017

What is npm and how is it useful?

npm is the package manager for JavaScript and the world’s largest software registry. npm is distributed with Node.js- which means that when you download Node.js, you automatically get npm installed on your computer.

Test if you have installed Node.JS and npm. There are lots of versions of Node.JS and npm and be aware of the versions and their compatibility.


NodeNmpInstalled.png

npm registry has the largest(millions) number of packages of free, reusable code.
Depending on your needs you may choose one of these account types for using npm.


Node_NpmAccTypes

It provides an huge registry with many different programs like jQuery, AngularJS etc.

For exmple, if you are installing Cordova pacakge you can do so from command-line like in here;

 C:\>npm install -g cordova

The -g switch means globally, otherwise it will be installed in the node_modules subdirectory.

Here is how you run the help file for npm:


Node_npmHelp

npm master reference here:
https://www.npmjs.com/

No comments: