@@ -19,15 +19,15 @@ convenient.
1919
2020## Class: ChildProcess
2121
22- ` ChildProcess ` is an [ EventEmitter] [ ] .
22+ ` ChildProcess ` is an [ ` EventEmitter ` ] [ ] .
2323
2424Child processes always have three streams associated with them. ` child.stdin ` ,
2525` child.stdout ` , and ` child.stderr ` . These may be shared with the stdio
2626streams of the parent process, or they may be separate stream objects
2727which can be piped to and from.
2828
2929The ChildProcess class is not intended to be used directly. Use the
30- ` spawn() ` , ` exec() ` , ` execFile() ` , or ` fork() ` methods to create a Child
30+ [ ` spawn() ` ] [ ] , [ ` exec() ` ] [ ] , [ ` execFile() ` ] [ ] , or [ ` fork() ` ] [ ] methods to create a Child
3131Process instance.
3232
3333### Event: 'close'
@@ -37,7 +37,7 @@ Process instance.
3737 was killed by the parent.
3838
3939This event is emitted when the stdio streams of a child process have all
40- terminated. This is distinct from 'exit', since multiple processes
40+ terminated. This is distinct from ` 'exit' ` , since multiple processes
4141might share the same stdio streams.
4242
4343### Event: 'disconnect'
@@ -56,7 +56,7 @@ Emitted when:
56562 . The process could not be killed, or
57573 . Sending a message to the child process failed for whatever reason.
5858
59- Note that the ` exit ` - event may or may not fire after an error has occurred. If
59+ Note that the ` ' exit' ` event may or may not fire after an error has occurred. If
6060you are listening on both events to fire a function, remember to guard against
6161calling your function twice.
6262
@@ -75,20 +75,20 @@ of the signal, otherwise `null`.
7575
7676Note that the child process stdio streams might still be open.
7777
78- Also, note that Node.js establishes signal handlers for ` ' SIGINT' ` and
79- ` ' SIGTERM` ' , so it will not terminate due to receipt of those signals,
78+ Also, note that Node.js establishes signal handlers for ` SIGINT ` and
79+ ` SIGTERM ` , so it will not terminate due to receipt of those signals,
8080it will exit.
8181
8282See ` waitpid(2) ` .
8383
8484### Event: 'message'
8585
8686* ` message ` {Object} a parsed JSON object or primitive value.
87- * ` sendHandle ` {Handle object} a [ net.Socket] [ ] or [ net.Server] [ ] object, or
87+ * ` sendHandle ` {Handle object} a [ ` net.Socket ` ] [ ] or [ ` net.Server ` ] [ ] object, or
8888 undefined.
8989
9090Messages sent by ` .send(message, [sendHandle]) ` are obtained using the
91- ` message ` event.
91+ ` ' message' ` event.
9292
9393### child.connected
9494
@@ -103,11 +103,11 @@ gracefully once there are no other connections keeping it alive. After calling
103103this method the ` .connected ` flag will be set to ` false ` in both the parent and
104104child, and it is no longer possible to send messages.
105105
106- The 'disconnect' event will be emitted when there are no messages in the process
106+ The ` 'disconnect' ` event will be emitted when there are no messages in the process
107107of being received, most likely immediately.
108108
109109Note that you can also call ` process.disconnect() ` in the child process when the
110- child process has any open IPC channels with the parent (i.e ` fork() ` ).
110+ child process has any open IPC channels with the parent (i.e [ ` fork() ` ] [ ] ).
111111
112112### child.kill([ signal] )
113113
@@ -188,17 +188,17 @@ will emit objects each time it receives a message on its channel.
188188
189189There is a special case when sending a ` {cmd: 'NODE_foo'} ` message. All messages
190190containing a ` NODE_ ` prefix in its ` cmd ` property will not be emitted in
191- the ` message ` event, since they are internal messages used by Node.js core.
192- Messages containing the prefix are emitted in the ` internalMessage ` event.
191+ the ` ' message' ` event, since they are internal messages used by Node.js core.
192+ Messages containing the prefix are emitted in the ` ' internalMessage' ` event.
193193Avoid using this feature; it is subject to change without notice.
194194
195195The ` sendHandle ` option to ` child.send() ` is for sending a TCP server or
196196socket object to another process. The child will receive the object as its
197- second argument to the ` message ` event.
197+ second argument to the ` ' message' ` event.
198198
199199The ` callback ` option is a function that is invoked after the message is
200200sent but before the target may have received it. It is called with a single
201- argument: ` null ` on success, or an ` Error ` object on failure.
201+ argument: ` null ` on success, or an [ ` Error ` ] [ ] object on failure.
202202
203203` child.send() ` emits an ` 'error' ` event if no callback was given and the message
204204cannot be sent, for example because the child process has already exited.
@@ -237,7 +237,7 @@ Note that the server is now shared between the parent and child, this means
237237that some connections will be handled by the parent and some by the child.
238238
239239For ` dgram ` servers the workflow is exactly the same. Here you listen on
240- a ` message ` event instead of ` connection ` and use ` server.bind ` instead of
240+ a ` ' message' ` event instead of ` ' connection' ` and use ` server.bind ` instead of
241241` server.listen ` . (Currently only supported on UNIX platforms.)
242242
243243#### Example: sending socket object
@@ -308,7 +308,7 @@ to the same object, or null.
308308* {Array}
309309
310310A sparse array of pipes to the child process, corresponding with positions in
311- the [ stdio] [ ] option to [ spawn] [ ] that have been set to ` 'pipe' ` .
311+ the [ ` stdio ` ] [ ] option to [ ` spawn() ` ] [ ] that have been set to ` 'pipe' ` .
312312Note that streams 0-2 are also available as ChildProcess.stdin,
313313ChildProcess.stdout, and ChildProcess.stderr, respectively.
314314
@@ -392,7 +392,7 @@ Runs a command in a shell and buffers the output.
392392 });
393393
394394The callback gets the arguments ` (error, stdout, stderr) ` . On success, ` error `
395- will be ` null ` . On error, ` error ` will be an instance of ` Error ` and ` error.code `
395+ will be ` null ` . On error, ` error ` will be an instance of [ ` Error ` ] [ ] and ` error.code `
396396will be the exit code of the child process, and ` error.signal ` will be set to the
397397signal that terminated the process.
398398
@@ -452,7 +452,7 @@ leaner than [`child_process.exec()`][]. It has the same options.
452452 (Default: ` process.execArgv ` )
453453 * ` silent ` {Boolean} If true, stdin, stdout, and stderr of the child will be
454454 piped to the parent, otherwise they will be inherited from the parent, see
455- the " pipe" and " inherit" options for ` spawn() ` 's ` stdio ` for more details
455+ the ` ' pipe' ` and ` ' inherit' ` options for [ ` spawn() ` ] [ ] 's [ ` stdio ` ] [ ] for more details
456456 (default is false)
457457 * ` uid ` {Number} Sets the user identity of the process. (See setuid(2).)
458458 * ` gid ` {Number} Sets the group identity of the process. (See setgid(2).)
@@ -473,7 +473,7 @@ done with care and by default will talk over the fd represented an
473473environmental variable ` NODE_CHANNEL_FD ` on the child process. The input and
474474output on this fd is expected to be line delimited JSON objects.
475475
476- * Note: Unlike the ` fork() ` POSIX system call, ` child_process.fork() ` does not clone the
476+ * Note: Unlike the ` fork() ` POSIX system call, [ ` child_process.fork() ` ] [ ] does not clone the
477477current process.*
478478
479479### child_process.spawn(command[ , args] [ , options ] )
@@ -614,7 +614,7 @@ As a shorthand, the `stdio` argument may be one of the following strings:
614614* ` 'ignore' ` - ` ['ignore', 'ignore', 'ignore'] `
615615* ` 'inherit' ` - ` [process.stdin, process.stdout, process.stderr] ` or ` [0,1,2] `
616616
617- Otherwise, the 'stdio' option to ` child_process.spawn() ` is an array where each
617+ Otherwise, the ` 'stdio' ` option to [ ` child_process.spawn() ` ] [ ] is an array where each
618618index corresponds to a fd in the child. The value is one of the following:
619619
6206201 . ` 'pipe' ` - Create a pipe between the child process and the parent process.
@@ -698,7 +698,7 @@ the `SIGTERM` signal and doesn't exit, your process will wait until the child
698698process has exited.
699699
700700If the process times out, or has a non-zero exit code, this method *** will***
701- throw. The ` Error ` object will contain the entire result from
701+ throw. The [ ` Error ` ] [ ] object will contain the entire result from
702702[ ` child_process.spawnSync() ` ] [ ]
703703
704704### child_process.execSync(command[ , options] )
@@ -732,7 +732,7 @@ the `SIGTERM` signal and doesn't exit, your process will wait until the child
732732process has exited.
733733
734734If the process times out, or has a non-zero exit code, this method *** will***
735- throw. The ` Error ` object will contain the entire result from
735+ throw. The [ ` Error ` ] [ ] object will contain the entire result from
736736[ ` child_process.spawnSync() ` ] [ ]
737737
738738### child_process.spawnSync(command[ , args] [ , options ] )
@@ -767,16 +767,20 @@ until the process has completely exited. That is to say, if the process handles
767767the ` SIGTERM ` signal and doesn't exit, your process will wait until the child
768768process has exited.
769769
770- [ below ] : #child_process_asynchronous_process_creation
771- [ synchronous counterparts ] : #child_process_synchronous_process_creation
772- [ EventEmitter ] : events.html#events_class_events_eventemitter
773- [ `ChildProcess#kill()` ] : #child_process_child_kill_signal
774- [ `ChildProcess#send()` ] : #child_process_child_send_message_sendhandle_callback
775- [ net.Server ] : net.html#net_class_net_server
776- [ net.Socket ] : net.html#net_class_net_socket
777- [ `child_process.fork()` ] : #child_process_child_process_fork_modulepath_args_options
778- [ stdio ] : #child_process_options_stdio
779- [ spawn ] : #child_process_child_process_spawn_command_args_options
780770[ `child_process.exec()` ] : #child_process_child_process_exec_command_options_callback
771+ [ `child_process.fork()` ] : #child_process_child_process_fork_modulepath_args_options
781772[ `child_process.spawn()` ] : #child_process_child_process_spawn_command_args_options
782773[ `child_process.spawnSync()` ] : #child_process_child_process_spawnsync_command_args_options
774+ [ `ChildProcess#kill()` ] : #child_process_child_kill_signal
775+ [ `ChildProcess#send()` ] : #child_process_child_send_message_sendhandle_callback
776+ [ `Error` ] : errors.html#errors_class_error
777+ [ `EventEmitter` ] : events.html#events_class_events_eventemitter
778+ [ `exec()` ] : #child_process_child_process_exec_command_options_callback
779+ [ `execFile()` ] : #child_process_child_process_execfile_file_args_options_callback
780+ [ `fork()` ] : #child_process_child_process_fork_modulepath_args_options
781+ [ `net.Server` ] : net.html#net_class_net_server
782+ [ `net.Socket` ] : net.html#net_class_net_socket
783+ [ `spawn()` ] : #child_process_child_process_spawn_command_args_options
784+ [ `stdio` ] : #child_process_options_stdio
785+ [ below ] : #child_process_asynchronous_process_creation
786+ [ synchronous counterparts ] : #child_process_synchronous_process_creation
0 commit comments