- pm2 start app.js --name tcp-owner
- pm2 stop 0
- pm2 flush 删除日志
- pm2 logs --lines 200 0 查看日志
pm2 monit 查看所有进程
pm2 describe 0 查看进程的所有信息
pm2 restart all
pm2 reloadLogs
- 文档:http://pm2.keymetrics.io/docs/usage/quick-start/
PM2 can automatically restart your application when a file is modified in the current directory or its subdirectories:
pm2 start app.js --watch
If
--watch
is enabled, stopping it won’t stop watching:pm2 stop 0
will not stop watchingpm2 stop --watch 0
will stop watching
可以检测问价改动,自动重启 --watch