Posts

Showing posts from May, 2019

PM2 cheat sheet | PM2 commands | PM2 tutorial

Image
PM2 PM2 (Process Manager): PM2 is a process manager for Node.JS apps when I want to keep node app to run in the background mostly use pm2 for it. I wanted to understand all its commands and its use so I went through its document, and write down some useful commands, then I thought let's share this as cheatsheet with all of you might be this can be useful for all of you. PM2 Cheatsheet: Start-Process: pm2 start server.js --name crudapp It will start server.js app with name as crud app. pm2 start server.js --no-daemon It will run pm2 daemon in the foreground if it doesn’t exist already. pm2 start server.js --no-autorestart It will not auto restart if the server stops. pm2 start server.js --no-vizion It will skip the versioning control mode. pm2 start server.js -i 0 It will start maximum processes with LB depending on available CPUs. pm2 start all It will start all existing process and restart if already ru...