How to use the start function from pm2

Find comprehensive JavaScript pm2.start code examples handpicked from public code repositorys.

36
37
38
39
40
41
42
43
44
45
program
  .command('start')
  .description('Start Raneto Service')
  .action(() => {
    pm2.connect(() => {
      pm2.start(
        {
          script: path.normalize(path.join(__dirname, '..', 'server.js')),
          exec_mode: 'fork',
          instances: 1,
fork icon449
star icon0
watch icon0

56
57
58
59
60
61
62
63
64
65
if (err) {
    console.error(err);
    process.exit(1);
}
console.warn("Run pm2 startup to start AutoDeploy on reboot!")
pm2.start(__dirname + '/../lib/server.js',{
    "name": "AutoDeploy Server"
}, function (err) {
    pm2.disconnect();
    if (err) console.log("PM2 daemon is already running!" + err);
fork icon1
star icon20
watch icon2

+ 9 other calls in file

10
11
12
13
14
15
16
17
18
19
}




pm2.start({
  script: 'index.js',
  name: 'worker',
  log: true,
  log_level: 'debug'
fork icon0
star icon0
watch icon0