@@ -12,10 +12,9 @@ data you send to the child process may not be immediately consumed.)
12
12
13
13
To create a child process use ` require('child_process').spawn() ` or
14
14
` require('child_process').fork() ` . The semantics of each are slightly
15
- different, and explained [ below] ( #child_process_asynchronous_process_creation ) .
15
+ different, and explained [ below] [ ] .
16
16
17
- For scripting purposes you may find the
18
- [ synchronous counterparts] ( #child_process_synchronous_process_creation ) more
17
+ For scripting purposes you may find the [ synchronous counterparts] [ ] more
19
18
convenient.
20
19
21
20
## Class: ChildProcess
@@ -61,8 +60,7 @@ Note that the `exit`-event may or may not fire after an error has occurred. If
61
60
you are listening on both events to fire a function, remember to guard against
62
61
calling your function twice.
63
62
64
- See also [ ` ChildProcess#kill() ` ] ( #child_process_child_kill_signal ) and
65
- [ ` ChildProcess#send() ` ] ( #child_process_child_send_message_sendhandle_callback ) .
63
+ See also [ ` ChildProcess#kill() ` ] [ ] and [ ` ChildProcess#send() ` ] [ ] .
66
64
67
65
### Event: 'exit'
68
66
@@ -161,7 +159,7 @@ Example:
161
159
* ` callback ` {Function}
162
160
* Return: Boolean
163
161
164
- When using [ ` child_process.fork() ` ] ( #child_process_child_process_fork_modulepath_args_options ) you can write to the child using
162
+ When using [ ` child_process.fork() ` ] [ ] you can write to the child using
165
163
` child.send(message[, sendHandle][, callback]) ` and messages are received by
166
164
a ` 'message' ` event on the child.
167
165
@@ -309,9 +307,7 @@ to the same object, or null.
309
307
* {Array}
310
308
311
309
A sparse array of pipes to the child process, corresponding with positions in
312
- the [ stdio] ( #child_process_options_stdio ) option to
313
- [ spawn] ( #child_process_child_process_spawn_command_args_options ) that have been
314
- set to ` 'pipe' ` .
310
+ the [ stdio] [ ] option to [ spawn] [ ] that have been set to ` 'pipe' ` .
315
311
Note that streams 0-2 are also available as ChildProcess.stdin,
316
312
ChildProcess.stdout, and ChildProcess.stderr, respectively.
317
313
@@ -438,9 +434,9 @@ the existing process and uses a shell to execute the command.*
438
434
* ` stderr ` {Buffer}
439
435
* Return: ChildProcess object
440
436
441
- This is similar to [ ` child_process.exec() ` ] ( #child_process_child_process_exec_command_options_callback ) except it does not execute a
437
+ This is similar to [ ` child_process.exec() ` ] [ ] except it does not execute a
442
438
subshell but rather the specified file directly. This makes it slightly
443
- leaner than [ ` child_process.exec() ` ] ( #child_process_child_process_exec_command_options_callback ) . It has the same options.
439
+ leaner than [ ` child_process.exec() ` ] [ ] . It has the same options.
444
440
445
441
446
442
### child_process.fork(modulePath[ , args] [ , options ] )
@@ -461,10 +457,10 @@ leaner than [`child_process.exec()`](#child_process_child_process_exec_command_o
461
457
* ` gid ` {Number} Sets the group identity of the process. (See setgid(2).)
462
458
* Return: ChildProcess object
463
459
464
- This is a special case of the [ ` child_process.spawn() ` ] ( #child_process_child_process_spawn_command_args_options ) functionality for spawning Node.js
465
- processes. In addition to having all the methods in a normal ChildProcess
466
- instance, the returned object has a communication channel built-in. See
467
- [ ` child.send(message, [sendHandle]) ` ] ( #child_process_child_send_message_sendhandle_callback ) for details.
460
+ This is a special case of the [ ` child_process.spawn() ` ] [ ] functionality for
461
+ spawning Node.js processes. In addition to having all the methods in a normal
462
+ ChildProcess instance, the returned object has a communication channel built-in.
463
+ See [ ` child.send(message, [sendHandle]) ` ] [ ] for details.
468
464
469
465
These child Node.js processes are still whole new instances of V8. Assume at
470
466
least 30ms startup and 10mb memory for each new Node.js. That is, you cannot
@@ -662,7 +658,7 @@ Example:
662
658
// startd-style interface.
663
659
spawn('prg', [], { stdio: ['pipe', null, null, null, 'pipe'] });
664
660
665
- See also: [ ` child_process.exec() ` ] ( #child_process_child_process_exec_command_options_callback ) and [ ` child_process.fork() ` ] ( #child_process_child_process_fork_modulepath_args_options )
661
+ See also: [ ` child_process.exec() ` ] [ ] and [ ` child_process.fork() ` ] [ ]
666
662
667
663
## Synchronous Process Creation
668
664
@@ -702,11 +698,7 @@ process has exited.
702
698
703
699
If the process times out, or has a non-zero exit code, this method *** will***
704
700
throw. The ` Error ` object will contain the entire result from
705
- [ ` child_process.spawnSync() ` ] ( #child_process_child_process_spawnsync_command_args_options )
706
-
707
- [ EventEmitter ] : events.html#events_class_events_eventemitter
708
- [ net.Server ] : net.html#net_class_net_server
709
- [ net.Socket ] : net.html#net_class_net_socket
701
+ [ ` child_process.spawnSync() ` ] [ ]
710
702
711
703
### child_process.execSync(command[ , options] )
712
704
@@ -740,7 +732,7 @@ process has exited.
740
732
741
733
If the process times out, or has a non-zero exit code, this method *** will***
742
734
throw. The ` Error ` object will contain the entire result from
743
- [ ` child_process.spawnSync() ` ] ( #child_process_child_process_spawnsync_command_args_options )
735
+ [ ` child_process.spawnSync() ` ] [ ]
744
736
745
737
### child_process.spawnSync(command[ , args] [ , options ] )
746
738
@@ -773,3 +765,18 @@ timeout has been encountered and `killSignal` is sent, the method won't return
773
765
until the process has completely exited. That is to say, if the process handles
774
766
the ` SIGTERM ` signal and doesn't exit, your process will wait until the child
775
767
process has exited.
768
+
769
+ [ below ] : #child_process_asynchronous_process_creation
770
+ [ synchronous counterparts ] : #child_process_synchronous_process_creation
771
+ [ EventEmitter ] : events.html#events_class_events_eventemitter
772
+ [ `ChildProcess#kill()` ] : #child_process_child_kill_signal
773
+ [ `ChildProcess#send()` ] : #child_process_child_send_message_sendhandle_callback
774
+ [ net.Server ] : net.html#net_class_net_server
775
+ [ net.Socket ] : net.html#net_class_net_socket
776
+ [ `child_process.fork()` ] : #child_process_child_process_fork_modulepath_args_options
777
+ [ stdio ] : #child_process_options_stdio
778
+ [ spawn ] : #child_process_child_process_spawn_command_args_options
779
+ [ `child_process.exec()` ] : #child_process_child_process_exec_command_options_callback
780
+ [ `child_process.spawn()` ] : #child_process_child_process_spawn_command_args_options
781
+ [ ` child.send(message, [sendHandle]) ` ] : #child_process_child_send_message_sendhandle_callback
782
+ [ `child_process.spawnSync()` ] : #child_process_child_process_spawnsync_command_args_options
0 commit comments