Node PM2

  1. PM2 is Process Manager for Node.js applications.
  2. PM2 has built-in Load Balancer.
  3. PM2 keeps node.js applications running on production server.
  4. PM2 automatically restart server if it crashes or close, without any downtime.
  5. PM2 helps you to manage application logging, monitoring, and clustering.

Following are some very useful commands

Install PM2:
npm install pm2 --save
Start Server:
pm2 start app.js
Monitor PM2:
pm2 monit
PM2 Cluster Mode:

PM2 cluster mode allows Node.js applications to be scaled accross all CPUs available, without any changes in code.

pm2 start app.js -i max
Display Logs:
pm2 logs
List All Processes:
pm2 list
Stop All Processes:
pm2 stop all

Read more in details about Source: PM2