childprocess.stdio

child.stdio <Array> A sparse array of pipes to the child process, corresponding with positions in the stdio option passed to child_process.spawn() that have been set to the value 'pipe'. Note that child.stdio[0], child.stdio[1], and child.stdio[2] are also available as child.stdin, child.stdout, and child.stderr, respectively. In the following example, only the child's fd 1 (stdout) is configured as a pipe, so only the parent's child.stdio[1] is a stream, all other values in the array

childprocess.stdout

child.stdout <Stream> A Readable Stream that represents the child process's stdout. If the child was spawned with stdio[1] set to anything other than 'pipe', then this will be undefined. child.stdout is an alias for child.stdio[1]. Both properties will refer to the same value.

childprocess.send()

child.send(message[, sendHandle[, options]][, callback]) message <Object> sendHandle <Handle> options <Object> callback <Function> Return: <Boolean> When an IPC channel has been established between the parent and child ( i.e. when using child_process.fork()), the child.send() method can be used to send messages to the child process. When the child process is a Node.js instance, these messages can be received via the process.on('message') event. For exam

childprocess.pid

child.pid <Number> Integer Returns the process identifier (PID) of the child process. Example: const spawn = require('child_process').spawn; const grep = spawn('grep', ['ssh']); console.log(`Spawned child pid: ${grep.pid}`); grep.stdin.end();

childprocess.kill()

child.kill([signal]) signal <String> The child.kill() methods sends a signal to the child process. If no argument is given, the process will be sent the 'SIGTERM' signal. See signal(7) for a list of available signals. const spawn = require('child_process').spawn; const grep = spawn('grep', ['ssh']); grep.on('close', (code, signal) => { console.log( `child process terminated due to receipt of signal ${signal}`); }); // Send SIGHUP to process grep.kill('SIGHUP'); The ChildPr

checkExpectation event (http.ClientRequest)

Event: 'checkExpectation' function (request, response) { } Emitted each time a request with an http Expect header is received, where the value is not 100-continue. If this event isn't listened for, the server will automatically respond with a 417 Expectation Failed as appropriate. Note that when this event is emitted and handled, the request event will not be emitted.

childprocess.disconnect()

child.disconnect() Closes the IPC channel between parent and child, allowing the child to exit gracefully once there are no other connections keeping it alive. After calling this method the child.connected and process.connected properties in both the parent and child (respectively) will be set to false, and it will be no longer possible to pass messages between the processes. The 'disconnect' event will be emitted when there are no messages in the process of being received. This will most ofte

ChildProcess

Class: ChildProcess Instances of the ChildProcess class are EventEmitters that represent spawned child processes. Instances of ChildProcess are not intended to be created directly. Rather, use the child_process.spawn(), child_process.exec(), child_process.execFile(), or child_process.fork() methods to create instances of ChildProcess.

childprocess.connected

child.connected <Boolean> Set to false after .disconnect is called The child.connected property indicates whether it is still possible to send and receive messages from a child process. When child.connected is false, it is no longer possible to send or receive messages.

change event (fs.FSWatcher)

Event: 'change' event <String> The type of fs change filename <String> The filename that changed (if relevant/available) Emitted when something changes in a watched directory or file. See more details in fs.watch().