Using NPM JS Developers can make packages (or sometimes Modules) out out Code that they have developed, and publish in NPM registry. Other Developers can discover npm packages from these Registries and can download and reuse your code. Its very easy to version the packages and also keep track of the updates to NPM packages.

Packages or Modules are similar to what we call as Libraries in C and C++ world. So Similar to how Developers link to C, C++ libraries, they include these NPM packages/Modules. Usually packages are build to solve a very specific problem (such as package to accessing a database); So these specific packages are combined with more specific packages and, that’s how a bigger application is built in JS world.