@@ -40,9 +40,8 @@ the event loop until the spawned process either exits or is terminated.
40
40
41
41
For convenience, the ` child_process ` module provides a handful of synchronous
42
42
and asynchronous alternatives to [ ` child_process.spawn() ` ] [ ] and
43
- [ ` child_process.spawnSync() ` ] [ ] . Note that each of these alternatives are
44
- implemented on top of [ ` child_process.spawn() ` ] [ ] or
45
- [ ` child_process.spawnSync() ` ] [ ] .
43
+ [ ` child_process.spawnSync() ` ] [ ] . Each of these alternatives are implemented on
44
+ top of [ ` child_process.spawn() ` ] [ ] or [ ` child_process.spawnSync() ` ] [ ] .
46
45
47
46
* [ ` child_process.exec() ` ] [ ] : spawns a shell and runs a command within that
48
47
shell, passing the ` stdout ` and ` stderr ` to a callback function when
@@ -532,9 +531,9 @@ its own console window. Once enabled for a child process, it cannot be
532
531
disabled.
533
532
534
533
On non-Windows platforms, if ` options.detached ` is set to ` true ` , the child
535
- process will be made the leader of a new process group and session. Note that
536
- child processes may continue running after the parent exits regardless of
537
- whether they are detached or not. See setsid(2) for more information.
534
+ process will be made the leader of a new process group and session. Child
535
+ processes may continue running after the parent exits regardless of whether
536
+ they are detached or not. See setsid(2) for more information.
538
537
539
538
By default, the parent will wait for the detached child to exit. To prevent the
540
539
parent from waiting for a given ` subprocess ` to exit, use the
@@ -633,9 +632,9 @@ pipes between the parent and child. The value is one of the following:
633
632
5 . {Stream} object - Share a readable or writable stream that refers to a tty,
634
633
file, socket, or a pipe with the child process. The stream's underlying
635
634
file descriptor is duplicated in the child process to the fd that
636
- corresponds to the index in the ` stdio ` array. Note that the stream must
637
- have an underlying descriptor (file streams do not until the ` 'open' `
638
- event has occurred).
635
+ corresponds to the index in the ` stdio ` array. The stream must have an
636
+ underlying descriptor (file streams do not until the ` 'open' ` event has
637
+ occurred).
639
638
6 . Positive integer - The integer value is interpreted as a file descriptor
640
639
that is currently open in the parent process. It is shared with the child
641
640
process, similar to how {Stream} objects can be shared.
@@ -799,9 +798,9 @@ The `child_process.execSync()` method is generally identical to
799
798
[ ` child_process.exec() ` ] [ ] with the exception that the method will not return
800
799
until the child process has fully closed. When a timeout has been encountered
801
800
and ` killSignal ` is sent, the method won't return until the process has
802
- completely exited. Note that if the child process intercepts and handles the
803
- ` SIGTERM ` signal and doesn't exit, the parent process will wait until the child
804
- process has exited.
801
+ completely exited. If the child process intercepts and handles the ` SIGTERM `
802
+ signal and doesn't exit, the parent process will wait until the child process
803
+ has exited.
805
804
806
805
If the process times out or has a non-zero exit code, this method will throw.
807
806
The [ ` Error ` ] [ ] object will contain the entire result from
@@ -877,9 +876,9 @@ The `child_process.spawnSync()` method is generally identical to
877
876
[ ` child_process.spawn() ` ] [ ] with the exception that the function will not return
878
877
until the child process has fully closed. When a timeout has been encountered
879
878
and ` killSignal ` is sent, the method won't return until the process has
880
- completely exited. Note that if the process intercepts and handles the
881
- ` SIGTERM ` signal and doesn't exit, the parent process will wait until the child
882
- process has exited.
879
+ completely exited. If the process intercepts and handles the ` SIGTERM ` signal
880
+ and doesn't exit, the parent process will wait until the child process has
881
+ exited.
883
882
884
883
** If the ` shell ` option is enabled, do not pass unsanitized user input to this
885
884
function. Any input containing shell metacharacters may be used to trigger
@@ -950,13 +949,13 @@ exited, `code` is the final exit code of the process, otherwise `null`. If the
950
949
process terminated due to receipt of a signal, ` signal ` is the string name of
951
950
the signal, otherwise ` null ` . One of the two will always be non-null.
952
951
953
- Note that when the ` 'exit' ` event is triggered, child process stdio streams
954
- might still be open.
952
+ When the ` 'exit' ` event is triggered, child process stdio streams might still be
953
+ open.
955
954
956
- Also, note that Node.js establishes signal handlers for ` SIGINT ` and
957
- ` SIGTERM ` and Node.js processes will not terminate immediately due to receipt
958
- of those signals. Rather, Node.js will perform a sequence of cleanup actions
959
- and then will re-raise the handled signal.
955
+ Node.js establishes signal handlers for ` SIGINT ` and ` SIGTERM ` and Node.js
956
+ processes will not terminate immediately due to receipt of those signals.
957
+ Rather, Node.js will perform a sequence of cleanup actions and then will
958
+ re-raise the handled signal.
960
959
961
960
See waitpid(2).
962
961
@@ -1011,7 +1010,7 @@ The `'disconnect'` event will be emitted when there are no messages in the
1011
1010
process of being received. This will most often be triggered immediately after
1012
1011
calling ` subprocess.disconnect() ` .
1013
1012
1014
- Note that when the child process is a Node.js instance (e.g. spawned using
1013
+ When the child process is a Node.js instance (e.g. spawned using
1015
1014
[ ` child_process.fork() ` ] ), the ` process.disconnect() ` method can be invoked
1016
1015
within the child process to close the IPC channel as well.
1017
1016
@@ -1045,8 +1044,8 @@ is not an error but may have unforeseen consequences. Specifically, if the
1045
1044
process identifier (PID) has been reassigned to another process, the signal will
1046
1045
be delivered to that process instead which can have unexpected results.
1047
1046
1048
- Note that while the function is called ` kill ` , the signal delivered to the
1049
- child process may not actually terminate the process.
1047
+ While the function is called ` kill ` , the signal delivered to the child process
1048
+ may not actually terminate the process.
1050
1049
1051
1050
See kill(2) for reference.
1052
1051
@@ -1330,8 +1329,8 @@ added: v0.1.90
1330
1329
1331
1330
A ` Writable Stream ` that represents the child process's ` stdin ` .
1332
1331
1333
- Note that if a child process waits to read all of its input, the child will not
1334
- continue until this stream has been closed via ` end() ` .
1332
+ If a child process waits to read all of its input, the child will not continue
1333
+ until this stream has been closed via ` end() ` .
1335
1334
1336
1335
If the child was spawned with ` stdio[0] ` set to anything other than ` 'pipe' ` ,
1337
1336
then this will be ` null ` .
@@ -1348,8 +1347,8 @@ added: v0.7.10
1348
1347
1349
1348
A sparse array of pipes to the child process, corresponding with positions in
1350
1349
the [ ` stdio ` ] [ ] option passed to [ ` child_process.spawn() ` ] [ ] that have been set
1351
- to the value ` 'pipe' ` . Note that ` subprocess.stdio[0] ` , ` subprocess.stdio[1] ` ,
1352
- and ` subprocess.stdio[2] ` are also available as ` subprocess.stdin ` ,
1350
+ to the value ` 'pipe' ` . ` subprocess.stdio[0] ` , ` subprocess.stdio[1] ` , and
1351
+ ` subprocess.stdio[2] ` are also available as ` subprocess.stdin ` ,
1353
1352
` subprocess.stdout ` , and ` subprocess.stderr ` , respectively.
1354
1353
1355
1354
In the following example, only the child's fd ` 1 ` (stdout) is configured as a
0 commit comments