A tool or a set of tools that helps during the development period to automate restarting of your app, while on production makes sure that your app is always up
Process Managers etc
nodemon
pm2
strongloop
supervizer
forever
...
nodemon
For use during development of a node.js based application.
nodemon will watch the files in the directory in which nodemon was started, and if any files change, nodemon will automatically restart your node application.
nodemon
nodemon does not require any changes to your code or method of development. nodemon simply wraps your node application and keeps an eye on any files that have changed. Remember that nodemon is a replacement wrapper for node, think of it as replacing the word "node" on the command line when you run your script.
nodemon
installation
npm install -g nodemon
nodemon
usage
nodemon [your node app]
nodemon ./server.js localhost 8080
If you have a package.json file for your app, you can omit the main script entirely and nodemon will read the package.json for the main property and use that value as the app.
pm2
PM2 is a production process manager for Node.js / io.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.
$ pm2 start app.js -i 0
# Enable load-balancer and cluster features
$ pm2 reload all
# Reload all apps in 0s manner
$ pm2 scale <app_name><instance_number># Increase / Decrease process number