-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Mastering Node.js
By :

All instances of the ChildProcess
object extend EventEmitter
, exposing events useful for managing child data connections. Additionally, ChildProcess
objects expose some useful methods for interacting with children directly. Let's go through those now, beginning with attributes and methods:
child.connected
: When a child is disconnected from its parent via child.disconnect()
, this flag will be set to false
.
child.stdin
: This is a WritableStream
corresponding to the child's standard in.
child.stdout
: This is a ReadableStream
corresponding to the child's standard out.
child.stderr
: This is a ReadableStream
corresponding to the child's standard error.
child.pid
: This is an integer representing the process ID (PID) assigned to the child process.
child.kill
: This tries to terminate a child process, sending it an optional signal. If no signal is specified, the default is SIGTERM
(for more about signals, see http://unixhelp.ed.ac.uk/CGI/man-cgi?signal+7). While the method...