All Node.js installations come with npm or the Node.js Package Manager, a utility for easily downloading, installing, updating, and removing Node.js libraries, modules, or entire applications. The npm utility is just like APT for some *NIX systems and works exclusively from Node's command-line interface.
Besides being a Node CLI tool, npm is also an online registry where developers can publish their JavaScript libraries, and from where other developers can download the JS files and check to see for recent updates. npm's home and central repository is npmjs.com, and it currently hosts not only Node.js modules, but jQuery plugins as well, since February 2015 to be more exactly.
If you're starting out, there are a few npm commands that are crucial, and you should be well aware of. First is:
This command is regularly used only when developing JavaScript applications, and after the code is finished, the package's name is added to a package.json file as a requirement for the library to work for other developers, without actually packaging the library along with the app's source.
When someone else downloads the application, they can simply access the folder via the command-line and run “npm install” without any other parameters. This makes npm read the package.json file, download all required packages (minimum versions supported) and install them locally so the application can function as normal.
There's also another form of npm install, which is:
The opposite of this command is:
Updating packages is also a trivial task via:
Similar to the APT in Linux, npm also comes with a search function to allow developers to locate the packages they like, that also features a very simplistic and easy-to-remember syntax: