| name | pm2 |
| description | Use this skill when the user wants to manage Node.js processes with pm2. |
PM2 Plugin
Process manager for Node.js applications. Production-grade process manager.
Commands
Process Management
pm2 process list — List all processes
pm2 process start — Start a process
pm2 process stop — Stop a process
pm2 process restart — Restart a process
pm2 process delete — Delete a process
Usage Examples
- "pm2 process start --script index.js"
- "pm2 process stop --id 0"
- "pm2 process list"
Installation
npm install -g pm2
Examples
pm2 start index.js
pm2 start index.js --name myapp
pm2 start index.js -i 4
pm2 list
pm2 stop 0
pm2 stop myapp
pm2 restart 0
pm2 restart all
pm2 delete 0
pm2 delete all
pm2 logs
pm2 monit
pm2 save
pm2 startup
Key Features
- Process management (start, stop, restart, delete)
- Clustering mode for load balancing
- Automatic restart on crash
- Log management
- Monitoring and metrics
- Zero-downtime reloads
- Process persistence across reboots