node-routine-handler

1.0.4 • Public • Published

Features

  • Create 'n' number of Child Node Processes with custom execution commands
  • Stop-Restart created custom processes.

Requirements

This package requires Node.js v8+ to run.

Installation

$ npm install node-routine-handler

Usage

Initialise

// nodeMaster(_state,procInstance,runCmd)
var nodeMaster  = require('node-routine-handler');

Start

var procInstance = nodeMaster('start');

Restart

var new_procInstance = nodeMaster('restart',procInstance);

Stop

nodeMaster('stop',procInstance);
  • __ state: 'start'|'stop'|'restart'
  • procInstance: An instance of the child node process returned on __state='start' to be passed when stoping or restarting a particular node process
  • runCmd: the command to be executed in child node process (default:'node server')

Development

Want to contribute? Great!

https://github.com/ronork/nodeRoutineHandler

License

ISC

Package Sidebar

Install

npm i node-routine-handler

Weekly Downloads

0

Version

1.0.4

License

ISC

Unpacked Size

2.94 kB

Total Files

3

Last publish

Collaborators

  • ronork