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

Dependencies (9)

Dev Dependencies (5)

Package Sidebar

Install

npm i lark-PM

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • viringbells