node index.js
nodemon index.js
Advanced, production process manager for Node.js with a built-in load balancer
npm i pm2 -g
yarn global add pm2
pm2 start app -n app-name
pm2 stop app
pm2 restart app
pm2 delete app
pm2 startup
sudo su -c "env
PATH=$PATH:/home/unitech/.nvm/versions/node/v4.3/bin
pm2 startup <distribution> -u <user>
--hp <home-path></home-path>
pm2 logs
pm2 logs app
pm2 flush
pm2 list
pm2 monit
pm2 describe app
pm2 start app -i max
pm2 reload app
module.exports = {
apps: [{
name: 'worker',
script: './worker.js',
watch: true,
},
{
name: 'api-app',
script: './api.js',
instances: 4,
exec_mode: 'cluster',
}],
};
pm2 start config
pm2 stop config
pm2 restart config
pm2 reload config
pm2 install <module>
pm2 install pm2-logrotate
automatically rotate logs of processes managed by PM2
pm2 install pm2-webshell
Fully capable Webshell
pm2 install pm2-server-monit
Automatically monitor vital signs of your server
forever.js
A simple CLI tool for ensuring that a given script runs continuously
StongLoop
A production process manager for Node.js applications