process-on-spawn

Execute callbacks when child processes are spawned.
Usage
'use strict';
const processOnSpawn = require('process-on-spawn');
processOnSpawn.addListener(opts => {
opts.env.CHILD_VARIABLE = 'value';
});
listener(opts)
options <Object>
execPath <string> The command to run.
args <string[]> Arguments of the child process.
cwd <string> Current working directory of the child process.
All properties except env are read-only.
processOnSpawn.addListener(listener)
Add a listener to be called after any listeners already attached.
processOnSpawn.prependListener(listener)
Insert a listener to be called before any listeners already attached.
processOnSpawn.removeListener(listener)
Remove the specified listener. If the listener was added multiple times only
the first is removed.
processOnSpawn.removeAllListeners()
Remove all attached listeners.