npm is a package manager for Node.js. It was created to allow developers (package authors) share packaged modules of code (programs) with the others.
It is a command line client that allows developers to install and publish software packages (modules).
Developers who create a package (program) and wish to share it with the other developers, can publish the package to the npm registry. The other developers can then download the shared package from the npm registry and can install it on their computers.