1
- # Child Process
1
+ # Child process
2
2
3
3
<!-- introduced_in=v0.10.0-->
4
4
@@ -70,7 +70,7 @@ For certain use cases, such as automating shell scripts, the
70
70
the synchronous methods can have significant impact on performance due to
71
71
stalling the event loop while spawned processes complete.
72
72
73
- ## Asynchronous Process Creation
73
+ ## Asynchronous process creation
74
74
75
75
The [ ` child_process.spawn() ` ] [ ] , [ ` child_process.fork() ` ] [ ] , [ ` child_process.exec() ` ] [ ] ,
76
76
and [ ` child_process.execFile() ` ] [ ] methods all follow the idiomatic asynchronous
@@ -153,7 +153,7 @@ changes:
153
153
* ` env ` {Object} Environment key-value pairs. ** Default:** ` process.env ` .
154
154
* ` encoding ` {string} ** Default:** ` 'utf8' `
155
155
* ` shell ` {string} Shell to execute the command with. See
156
- [ Shell Requirements ] [ ] and [ Default Windows Shell ] [ ] . ** Default:**
156
+ [ Shell requirements ] [ ] and [ Default Windows shell ] [ ] . ** Default:**
157
157
` '/bin/sh' ` on Unix, ` process.env.ComSpec ` on Windows.
158
158
* ` timeout ` {number} ** Default:** ` 0 `
159
159
* ` maxBuffer ` {number} Largest amount of data in bytes allowed on stdout or
@@ -270,8 +270,8 @@ changes:
270
270
done on Windows. Ignored on Unix. ** Default:** ` false ` .
271
271
* ` shell ` {boolean|string} If ` true ` , runs ` command ` inside of a shell. Uses
272
272
` '/bin/sh' ` on Unix, and ` process.env.ComSpec ` on Windows. A different
273
- shell can be specified as a string. See [ Shell Requirements ] [ ] and
274
- [ Default Windows Shell ] [ ] . ** Default:** ` false ` (no shell).
273
+ shell can be specified as a string. See [ Shell requirements ] [ ] and
274
+ [ Default Windows shell ] [ ] . ** Default:** ` false ` (no shell).
275
275
* ` callback ` {Function} Called with the output when process terminates.
276
276
* ` error ` {Error}
277
277
* ` stdout ` {string|Buffer}
@@ -355,7 +355,7 @@ changes:
355
355
** Default:** ` process.execArgv ` .
356
356
* ` serialization ` {string} Specify the kind of serialization used for sending
357
357
messages between processes. Possible values are ` 'json' ` and ` 'advanced' ` .
358
- See [ Advanced Serialization ] [ ] for more details. ** Default:** ` 'json' ` .
358
+ See [ Advanced serialization ] [ ] for more details. ** Default:** ` 'json' ` .
359
359
* ` silent ` {boolean} If ` true ` , stdin, stdout, and stderr of the child will be
360
360
piped to the parent, otherwise they will be inherited from the parent, see
361
361
the ` 'pipe' ` and ` 'inherit' ` options for [ ` child_process.spawn() ` ] [ ] 's
@@ -434,11 +434,11 @@ changes:
434
434
* ` gid ` {number} Sets the group identity of the process (see setgid(2)).
435
435
* ` serialization ` {string} Specify the kind of serialization used for sending
436
436
messages between processes. Possible values are ` 'json' ` and ` 'advanced' ` .
437
- See [ Advanced Serialization ] [ ] for more details. ** Default:** ` 'json' ` .
437
+ See [ Advanced serialization ] [ ] for more details. ** Default:** ` 'json' ` .
438
438
* ` shell ` {boolean|string} If ` true ` , runs ` command ` inside of a shell. Uses
439
439
` '/bin/sh' ` on Unix, and ` process.env.ComSpec ` on Windows. A different
440
- shell can be specified as a string. See [ Shell Requirements ] [ ] and
441
- [ Default Windows Shell ] [ ] . ** Default:** ` false ` (no shell).
440
+ shell can be specified as a string. See [ Shell requirements ] [ ] and
441
+ [ Default Windows shell ] [ ] . ** Default:** ` false ` (no shell).
442
442
* ` windowsVerbatimArguments ` {boolean} No quoting or escaping of arguments is
443
443
done on Windows. Ignored on Unix. This is set to ` true ` automatically
444
444
when ` shell ` is specified and is CMD. ** Default:** ` false ` .
@@ -699,7 +699,7 @@ see [V8 issue 7381](https://bugs.chromium.org/p/v8/issues/detail?id=7381).
699
699
700
700
See also: [ ` child_process.exec() ` ] [ ] and [ ` child_process.fork() ` ] [ ] .
701
701
702
- ## Synchronous Process Creation
702
+ ## Synchronous process creation
703
703
704
704
The [ ` child_process.spawnSync() ` ] [ ] , [ ` child_process.execSync() ` ] [ ] , and
705
705
[ ` child_process.execFileSync() ` ] [ ] methods are synchronous and will block the
@@ -755,8 +755,8 @@ changes:
755
755
normally be created on Windows systems. ** Default:** ` false ` .
756
756
* ` shell ` {boolean|string} If ` true ` , runs ` command ` inside of a shell. Uses
757
757
` '/bin/sh' ` on Unix, and ` process.env.ComSpec ` on Windows. A different
758
- shell can be specified as a string. See [ Shell Requirements ] [ ] and
759
- [ Default Windows Shell ] [ ] . ** Default:** ` false ` (no shell).
758
+ shell can be specified as a string. See [ Shell requirements ] [ ] and
759
+ [ Default Windows shell ] [ ] . ** Default:** ` false ` (no shell).
760
760
* Returns: {Buffer|string} The stdout from the command.
761
761
762
762
The ` child_process.execFileSync() ` method is generally identical to
@@ -804,7 +804,7 @@ changes:
804
804
** Default:** ` 'pipe' ` .
805
805
* ` env ` {Object} Environment key-value pairs. ** Default:** ` process.env ` .
806
806
* ` shell ` {string} Shell to execute the command with. See
807
- [ Shell Requirements ] [ ] and [ Default Windows Shell ] [ ] . ** Default:**
807
+ [ Shell requirements ] [ ] and [ Default Windows shell ] [ ] . ** Default:**
808
808
` '/bin/sh' ` on Unix, ` process.env.ComSpec ` on Windows.
809
809
* ` uid ` {number} Sets the user identity of the process. (See setuid(2)).
810
810
* ` gid ` {number} Sets the group identity of the process. (See setgid(2)).
@@ -884,8 +884,8 @@ changes:
884
884
** Default:** ` 'buffer' ` .
885
885
* ` shell ` {boolean|string} If ` true ` , runs ` command ` inside of a shell. Uses
886
886
` '/bin/sh' ` on Unix, and ` process.env.ComSpec ` on Windows. A different
887
- shell can be specified as a string. See [ Shell Requirements ] [ ] and
888
- [ Default Windows Shell ] [ ] . ** Default:** ` false ` (no shell).
887
+ shell can be specified as a string. See [ Shell requirements ] [ ] and
888
+ [ Default Windows shell ] [ ] . ** Default:** ` false ` (no shell).
889
889
* ` windowsVerbatimArguments ` {boolean} No quoting or escaping of arguments is
890
890
done on Windows. Ignored on Unix. This is set to ` true ` automatically
891
891
when ` shell ` is specified and is CMD. ** Default:** ` false ` .
@@ -1025,7 +1025,7 @@ message might not be the same as what is originally sent.
1025
1025
If the ` serialization ` option was set to ` 'advanced' ` used when spawning the
1026
1026
child process, the ` message ` argument can contain data that JSON is not able
1027
1027
to represent.
1028
- See [ Advanced Serialization ] [ ] for more details.
1028
+ See [ Advanced serialization ] [ ] for more details.
1029
1029
1030
1030
### ` subprocess.channel `
1031
1031
<!-- YAML
@@ -1544,21 +1544,21 @@ This impacts output that includes multibyte character encodings such as UTF-8 or
1544
1544
UTF-16. For instance, ` console.log('中文测试') ` will send 13 UTF-8 encoded bytes
1545
1545
to ` stdout ` although there are only 4 characters.
1546
1546
1547
- ## Shell Requirements
1547
+ ## Shell requirements
1548
1548
1549
1549
The shell should understand the ` -c ` switch. If the shell is ` 'cmd.exe' ` , it
1550
1550
should understand the ` /d /s /c ` switches and command line parsing should be
1551
1551
compatible.
1552
1552
1553
- ## Default Windows Shell
1553
+ ## Default Windows shell
1554
1554
1555
1555
Although Microsoft specifies ` %COMSPEC% ` must contain the path to
1556
1556
` 'cmd.exe' ` in the root environment, child processes are not always subject to
1557
1557
the same requirement. Thus, in ` child_process ` functions where a shell can be
1558
1558
spawned, ` 'cmd.exe' ` is used as a fallback if ` process.env.ComSpec ` is
1559
1559
unavailable.
1560
1560
1561
- ## Advanced Serialization
1561
+ ## Advanced serialization
1562
1562
<!-- YAML
1563
1563
added:
1564
1564
- v13.2.0
@@ -1579,7 +1579,7 @@ Therefore, this feature requires opting in by setting the
1579
1579
` serialization ` option to ` 'advanced' ` when calling [ ` child_process.spawn() ` ] [ ]
1580
1580
or [ ` child_process.fork() ` ] [ ] .
1581
1581
1582
- [ Advanced Serialization ] : #child_process_advanced_serialization
1582
+ [ Advanced serialization ] : #child_process_advanced_serialization
1583
1583
[ `'disconnect'` ] : process.html#process_event_disconnect
1584
1584
[ `'error'` ] : #child_process_event_error
1585
1585
[ `'exit'` ] : #child_process_event_exit
@@ -1612,8 +1612,8 @@ or [`child_process.fork()`][].
1612
1612
[ `subprocess.stdio` ] : #child_process_subprocess_stdio
1613
1613
[ `subprocess.stdout` ] : #child_process_subprocess_stdout
1614
1614
[ `util.promisify()` ] : util.html#util_util_promisify_original
1615
- [ Default Windows Shell ] : #child_process_default_windows_shell
1615
+ [ Default Windows shell ] : #child_process_default_windows_shell
1616
1616
[ HTML structured clone algorithm ] : https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
1617
- [ Shell Requirements ] : #child_process_shell_requirements
1617
+ [ Shell requirements ] : #child_process_shell_requirements
1618
1618
[ synchronous counterparts ] : #child_process_synchronous_process_creation
1619
1619
[ v8.serdes ] : v8.html#v8_serialization_api
0 commit comments