gulp-server-fork
Noop pipe plugin for spawning and killing a forked node js application
Examples
Simple
gulp
Full
gulp
ready event
For notifying the plugin when to liberate the pipe stream your app should emit a
ready
event through process.send
.
For example, using it with an express instance, the code would look as follows.
app;
Options
- id: The internal id for the process. This is useful if you are going to fork several
processes and want to kill them on different moments. Defaults to
Date.now()
- timeout: Time in milliseconds. Once this time has passed, if the spawned process
hasn't emitted a
ready
event, the pipe stream will continue. Defaults to20000
. - logfile: File where to dump the output of the spawned process. Defaults to
null
- env: Object. Environment passed to the spawned process.