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}
@@ -353,7 +353,7 @@ changes:
353
353
** Default:** ` process.execArgv ` .
354
354
* ` serialization ` {string} Specify the kind of serialization used for sending
355
355
messages between processes. Possible values are ` 'json' ` and ` 'advanced' ` .
356
- See [ Advanced Serialization ] [ ] for more details. ** Default:** ` 'json' ` .
356
+ See [ Advanced serialization ] [ ] for more details. ** Default:** ` 'json' ` .
357
357
* ` silent ` {boolean} If ` true ` , stdin, stdout, and stderr of the child will be
358
358
piped to the parent, otherwise they will be inherited from the parent, see
359
359
the ` 'pipe' ` and ` 'inherit' ` options for [ ` child_process.spawn() ` ] [ ] 's
@@ -430,11 +430,11 @@ changes:
430
430
* ` gid ` {number} Sets the group identity of the process (see setgid(2)).
431
431
* ` serialization ` {string} Specify the kind of serialization used for sending
432
432
messages between processes. Possible values are ` 'json' ` and ` 'advanced' ` .
433
- See [ Advanced Serialization ] [ ] for more details. ** Default:** ` 'json' ` .
433
+ See [ Advanced serialization ] [ ] for more details. ** Default:** ` 'json' ` .
434
434
* ` shell ` {boolean|string} If ` true ` , runs ` command ` inside of a shell. Uses
435
435
` '/bin/sh' ` on Unix, and ` process.env.ComSpec ` on Windows. A different
436
- shell can be specified as a string. See [ Shell Requirements ] [ ] and
437
- [ Default Windows Shell ] [ ] . ** Default:** ` false ` (no shell).
436
+ shell can be specified as a string. See [ Shell requirements ] [ ] and
437
+ [ Default Windows shell ] [ ] . ** Default:** ` false ` (no shell).
438
438
* ` windowsVerbatimArguments ` {boolean} No quoting or escaping of arguments is
439
439
done on Windows. Ignored on Unix. This is set to ` true ` automatically
440
440
when ` shell ` is specified and is CMD. ** Default:** ` false ` .
@@ -695,7 +695,7 @@ see [V8 issue 7381](https://bugs.chromium.org/p/v8/issues/detail?id=7381).
695
695
696
696
See also: [ ` child_process.exec() ` ] [ ] and [ ` child_process.fork() ` ] [ ] .
697
697
698
- ## Synchronous Process Creation
698
+ ## Synchronous process creation
699
699
700
700
The [ ` child_process.spawnSync() ` ] [ ] , [ ` child_process.execSync() ` ] [ ] , and
701
701
[ ` child_process.execFileSync() ` ] [ ] methods are synchronous and will block the
@@ -751,8 +751,8 @@ changes:
751
751
normally be created on Windows systems. ** Default:** ` false ` .
752
752
* ` shell ` {boolean|string} If ` true ` , runs ` command ` inside of a shell. Uses
753
753
` '/bin/sh' ` on Unix, and ` process.env.ComSpec ` on Windows. A different
754
- shell can be specified as a string. See [ Shell Requirements ] [ ] and
755
- [ Default Windows Shell ] [ ] . ** Default:** ` false ` (no shell).
754
+ shell can be specified as a string. See [ Shell requirements ] [ ] and
755
+ [ Default Windows shell ] [ ] . ** Default:** ` false ` (no shell).
756
756
* Returns: {Buffer|string} The stdout from the command.
757
757
758
758
The ` child_process.execFileSync() ` method is generally identical to
@@ -800,7 +800,7 @@ changes:
800
800
** Default:** ` 'pipe' ` .
801
801
* ` env ` {Object} Environment key-value pairs. ** Default:** ` process.env ` .
802
802
* ` shell ` {string} Shell to execute the command with. See
803
- [ Shell Requirements ] [ ] and [ Default Windows Shell ] [ ] . ** Default:**
803
+ [ Shell requirements ] [ ] and [ Default Windows shell ] [ ] . ** Default:**
804
804
` '/bin/sh' ` on Unix, ` process.env.ComSpec ` on Windows.
805
805
* ` uid ` {number} Sets the user identity of the process. (See setuid(2)).
806
806
* ` gid ` {number} Sets the group identity of the process. (See setgid(2)).
@@ -880,8 +880,8 @@ changes:
880
880
** Default:** ` 'buffer' ` .
881
881
* ` shell ` {boolean|string} If ` true ` , runs ` command ` inside of a shell. Uses
882
882
` '/bin/sh' ` on Unix, and ` process.env.ComSpec ` on Windows. A different
883
- shell can be specified as a string. See [ Shell Requirements ] [ ] and
884
- [ Default Windows Shell ] [ ] . ** Default:** ` false ` (no shell).
883
+ shell can be specified as a string. See [ Shell requirements ] [ ] and
884
+ [ Default Windows shell ] [ ] . ** Default:** ` false ` (no shell).
885
885
* ` windowsVerbatimArguments ` {boolean} No quoting or escaping of arguments is
886
886
done on Windows. Ignored on Unix. This is set to ` true ` automatically
887
887
when ` shell ` is specified and is CMD. ** Default:** ` false ` .
@@ -1021,7 +1021,7 @@ message might not be the same as what is originally sent.
1021
1021
If the ` serialization ` option was set to ` 'advanced' ` used when spawning the
1022
1022
child process, the ` message ` argument can contain data that JSON is not able
1023
1023
to represent.
1024
- See [ Advanced Serialization ] [ ] for more details.
1024
+ See [ Advanced serialization ] [ ] for more details.
1025
1025
1026
1026
### ` subprocess.channel `
1027
1027
<!-- YAML
@@ -1520,21 +1520,21 @@ This impacts output that includes multibyte character encodings such as UTF-8 or
1520
1520
UTF-16. For instance, ` console.log('中文测试') ` will send 13 UTF-8 encoded bytes
1521
1521
to ` stdout ` although there are only 4 characters.
1522
1522
1523
- ## Shell Requirements
1523
+ ## Shell requirements
1524
1524
1525
1525
The shell should understand the ` -c ` switch. If the shell is ` 'cmd.exe' ` , it
1526
1526
should understand the ` /d /s /c ` switches and command line parsing should be
1527
1527
compatible.
1528
1528
1529
- ## Default Windows Shell
1529
+ ## Default Windows shell
1530
1530
1531
1531
Although Microsoft specifies ` %COMSPEC% ` must contain the path to
1532
1532
` 'cmd.exe' ` in the root environment, child processes are not always subject to
1533
1533
the same requirement. Thus, in ` child_process ` functions where a shell can be
1534
1534
spawned, ` 'cmd.exe' ` is used as a fallback if ` process.env.ComSpec ` is
1535
1535
unavailable.
1536
1536
1537
- ## Advanced Serialization
1537
+ ## Advanced serialization
1538
1538
<!-- YAML
1539
1539
added: v12.16.0
1540
1540
-->
@@ -1553,7 +1553,7 @@ Therefore, this feature requires opting in by setting the
1553
1553
` serialization ` option to ` 'advanced' ` when calling [ ` child_process.spawn() ` ] [ ]
1554
1554
or [ ` child_process.fork() ` ] [ ] .
1555
1555
1556
- [ Advanced Serialization ] : #child_process_advanced_serialization
1556
+ [ Advanced serialization ] : #child_process_advanced_serialization
1557
1557
[ `'disconnect'` ] : process.html#process_event_disconnect
1558
1558
[ `'error'` ] : #child_process_event_error
1559
1559
[ `'exit'` ] : #child_process_event_exit
@@ -1586,8 +1586,8 @@ or [`child_process.fork()`][].
1586
1586
[ `subprocess.stdio` ] : #child_process_subprocess_stdio
1587
1587
[ `subprocess.stdout` ] : #child_process_subprocess_stdout
1588
1588
[ `util.promisify()` ] : util.html#util_util_promisify_original
1589
- [ Default Windows Shell ] : #child_process_default_windows_shell
1589
+ [ Default Windows shell ] : #child_process_default_windows_shell
1590
1590
[ HTML structured clone algorithm ] : https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
1591
- [ Shell Requirements ] : #child_process_shell_requirements
1591
+ [ Shell requirements ] : #child_process_shell_requirements
1592
1592
[ synchronous counterparts ] : #child_process_synchronous_process_creation
1593
1593
[ v8.serdes ] : v8.html#v8_serialization_api
0 commit comments