Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

lark-PM

0.1.1 • Public • Published

lark-pm

NPM version NPM downloads

Process manager of Lark Apps (or other node apps)

Install

$ npm install lark-PM

Get started

const pm = require('lark-PM');
const http = require('http');

/**
 * configure pm
 **/
/*
pm.configure({
  'background': false,
  'instances': 1,
  'log-file': 'logs/process_management.log',
  'daemon-dirname': __dirname,
});
*/

if (pm.isWorker) {
    http.createServer((req, res) => {
      res.write("Hello, " + process.pid + " is working for you");
      res.end();
    }).listen(3000);
}

then type node app.js, you'll get the app.js runing in foreground with one worker (and one master)

App status control

If you configure the pm with { background: true }, your app will be runing in background with forever.js

In this case, use the following commands to control your app

  • $ node app.js --lark-stop stop the app processes, including daemon, master and all workers
  • $ node app.js --lark-status show the app status

LICENCE

MIT

install

npm i lark-PM

Downloadsweekly downloads

13

version

0.1.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability