@sundawning/pm2-async

1.0.0 • Public • Published

将 pm2 的操作转为 async

2022-09-08 22:08:38

安装

pnpm add @sundawning/pm2-async

使用

const pm2 = require("@sundawning/pm2-async");
async function index() {
  await pm2.connect();
  console.log("list", await pm2.list());
  await pm2.disconnect();
}
index();

将打印出:

list [
  {
    pid: 12812,
    name: 'index',
    pm2_env: {
      kill_retry_time: 100,
      windowsHide: true,
      ...
      unstable_restarts: 0,
      version: '1.0.0',
      node_version: '18.0.0',
      versioning: [Object],
      exit_code: 0
    },
    pm_id: 0,
    monit: { memory: 43708416, cpu: 0 }
  }
]

Package Sidebar

Install

npm i @sundawning/pm2-async

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

2.58 kB

Total Files

4

Last publish

Collaborators

  • sundawning