Package Exports
- daemonize-process
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (daemonize-process) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
daemonize-process
Daemonize the current Node.js process
The module re-spawns the current process and then exits, which will lead to the new child process being adopted by init or similar mechanisms, effectively putting the current process into the background. Differences to the popular daemon module include:
- Fully configurable, exposes all options of
child_process.spawn. - Cleans up
process.envafter itself. - Works on Node.js >= 8.
Install
$ npm install --save daemonize-processExample
require('daemonize-process')();API
daemonizeProcess([options])
The options object can contain any valid child_process.spawn option as well as these properties:
scriptstring - The path to the script to be executed. Default: The current script.argumentsArray - The command line arguments to be used. Default: The current arguments.nodestring - The path to the Node.js binary to be used. Default: The current Node.js binary.exitCodenumber - The exit code to be used when exiting the parent process. Default:0.
By default the standard streams of the child are ignored (e.g. attached to /dev/null or equivalent). If you need these streams, adjust the stdio option.
License
© silverwind, distributed under BSD licence