1.0.0 • Published 2 years ago

@sundawning/pm2-start-js-file v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

使用 pm2 启动.js 文件,不重复启动。

2022-09-08 22:36:27

安装

pnpm add @sundawning/pm2-start-js-file

使用

const pm2 = require("@sundawning/pm2-start-js-file");
const path = require("path");
pm2.start({
  name: "pm2-start-js-file",
  script: path.resolve(__dirname, "./server.js"),
});

首次执行时:

正在运行 []
启动 pm2-start-js-file
{
  script: '\\@sundawning\\pm2-start-js-file\\server.js',
  name: 'pm2-start-js-file',
  cwd: undefined,
  args: undefined,
  env: { io: undefined },
  username: 'username',
  merge_logs: true
}

再次执行时:

正在运行 [ 'pm2-start-js-file' ]