npm

Need private packages and team management tools?Check out npm Orgs. »

rebirth

2.0.0 • Public • Published

rebirth

Restart a node process from within itself

Restarting is done by spawning a detached copy of the current process and subsequently ending the running process. The new child will be orphaned and parented to PID 1 (init/systemd/launchd).

Installation

$ npm install --save rebirth

Example

const rebirth = require('rebirth');
 
rebirth();
// process restarts

Notes:

  • To detect if a process was reborn, check if process.env.REBORN is '1';
  • Standard streams will be inherited by default. When running in a terminal, this means stdout/stderr will still print to that terminal after a restart. If you don't care about these streams, set opts.stdio = 'ignore'.

API

rebirth([options])

© silverwind, distributed under BSD licence

install

npm i rebirth

Downloadsweekly downloads

54

version

2.0.0

license

BSD-2-Clause

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability