2.0.0 • Published 6 years ago

rebirth v2.0.0

Weekly downloads
5
License
BSD-2-Clause
Repository
github
Last release
6 years ago

rebirth

npm.io npm.io npm.io

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

2.0.0

6 years ago

1.0.3

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.2.3

8 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago