Creating Node Packages

NPM is the node package manager (being extended to JavaScript in general). It is the common way to install any node package which enhances the functionality of node.

So far we have been using NPM to install packages we need to build our projects but we can also build our own packages to make our work easier. In particular, it used to package up our work to make it portable:

npm init
(Creates package.json)
npm install express --save
(Adds express to package.json dependencies so that it is installed when the package is installed.) Add:
"scripts": { "start": "node server.js" }
to package.json to tell it to start the server when we type "npm start"