- In my previous post we have introduced and configured PM2 process manager for a NodeJS application in Windows platform.
- In this Demo,”We will learn more PM2 Process Manager commands and use it to our demo application”.
- The sample project we have used is PM2Demo and looks like following screenshot.
- The server instance can be started with pm2 start server.js myserver command where myserver is instance name.The following screenshot shows the terminal with PM2 execution.
- To ensure PM2 daemon process is running use pm2 ping command.The following screenshot shows the terminal with PM2 ping command.
- To list all the PM2 processes we can use pm2 list command.The following screenshot shows the terminal with PM2 list command in execution.
- To print the PM2 process as unformatted JSON string use pm2 jlist command.The following screenshot shows the terminal with json list in execution.
- To print the PM2 process as formatted JSON used pm2 prettylist command.The following screenshot shows the pretty print in execution.
- To get description of a PM2 process use pm2 describe 0 where 0 is id of process command.The following screenshot shows terminal with description of myserver instance name.
- To stop the PM2 application instance use pm2 stop myserver command where myserver is the name of the instance.The following screenshot shows the stop command in execution.
- We will learn more pm2 command in my upcoming blog posts.till then stay tuned.