1- # Child Process
1+ # Child process
22
33<!-- introduced_in=v0.10.0-->
44
@@ -70,7 +70,7 @@ For certain use cases, such as automating shell scripts, the
7070the synchronous methods can have significant impact on performance due to
7171stalling the event loop while spawned processes complete.
7272
73- ## Asynchronous Process Creation
73+ ## Asynchronous process creation
7474
7575The [ ` child_process.spawn() ` ] [ ] , [ ` child_process.fork() ` ] [ ] , [ ` child_process.exec() ` ] [ ] ,
7676and [ ` child_process.execFile() ` ] [ ] methods all follow the idiomatic asynchronous
@@ -153,7 +153,7 @@ changes:
153153 * ` env ` {Object} Environment key-value pairs. ** Default:** ` process.env ` .
154154 * ` encoding ` {string} ** Default:** ` 'utf8' `
155155 * ` 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:**
157157 ` '/bin/sh' ` on Unix, ` process.env.ComSpec ` on Windows.
158158 * ` timeout ` {number} ** Default:** ` 0 `
159159 * ` maxBuffer ` {number} Largest amount of data in bytes allowed on stdout or
@@ -270,8 +270,8 @@ changes:
270270 done on Windows. Ignored on Unix. ** Default:** ` false ` .
271271 * ` shell ` {boolean|string} If ` true ` , runs ` command ` inside of a shell. Uses
272272 ` '/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).
275275* ` callback ` {Function} Called with the output when process terminates.
276276 * ` error ` {Error}
277277 * ` stdout ` {string|Buffer}
@@ -353,7 +353,7 @@ changes:
353353 ** Default:** ` process.execArgv ` .
354354 * ` serialization ` {string} Specify the kind of serialization used for sending
355355 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' ` .
357357 * ` silent ` {boolean} If ` true ` , stdin, stdout, and stderr of the child will be
358358 piped to the parent, otherwise they will be inherited from the parent, see
359359 the ` 'pipe' ` and ` 'inherit' ` options for [ ` child_process.spawn() ` ] [ ] 's
@@ -430,11 +430,11 @@ changes:
430430 * ` gid ` {number} Sets the group identity of the process (see setgid(2)).
431431 * ` serialization ` {string} Specify the kind of serialization used for sending
432432 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' ` .
434434 * ` shell ` {boolean|string} If ` true ` , runs ` command ` inside of a shell. Uses
435435 ` '/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).
438438 * ` windowsVerbatimArguments ` {boolean} No quoting or escaping of arguments is
439439 done on Windows. Ignored on Unix. This is set to ` true ` automatically
440440 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).
695695
696696See also: [ ` child_process.exec() ` ] [ ] and [ ` child_process.fork() ` ] [ ] .
697697
698- ## Synchronous Process Creation
698+ ## Synchronous process creation
699699
700700The [ ` child_process.spawnSync() ` ] [ ] , [ ` child_process.execSync() ` ] [ ] , and
701701[ ` child_process.execFileSync() ` ] [ ] methods are synchronous and will block the
@@ -751,8 +751,8 @@ changes:
751751 normally be created on Windows systems. ** Default:** ` false ` .
752752 * ` shell ` {boolean|string} If ` true ` , runs ` command ` inside of a shell. Uses
753753 ` '/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).
756756* Returns: {Buffer|string} The stdout from the command.
757757
758758The ` child_process.execFileSync() ` method is generally identical to
@@ -800,7 +800,7 @@ changes:
800800 ** Default:** ` 'pipe' ` .
801801 * ` env ` {Object} Environment key-value pairs. ** Default:** ` process.env ` .
802802 * ` 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:**
804804 ` '/bin/sh' ` on Unix, ` process.env.ComSpec ` on Windows.
805805 * ` uid ` {number} Sets the user identity of the process. (See setuid(2)).
806806 * ` gid ` {number} Sets the group identity of the process. (See setgid(2)).
@@ -880,8 +880,8 @@ changes:
880880 ** Default:** ` 'buffer' ` .
881881 * ` shell ` {boolean|string} If ` true ` , runs ` command ` inside of a shell. Uses
882882 ` '/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).
885885 * ` windowsVerbatimArguments ` {boolean} No quoting or escaping of arguments is
886886 done on Windows. Ignored on Unix. This is set to ` true ` automatically
887887 when ` shell ` is specified and is CMD. ** Default:** ` false ` .
@@ -1021,7 +1021,7 @@ message might not be the same as what is originally sent.
10211021If the ` serialization ` option was set to ` 'advanced' ` used when spawning the
10221022child process, the ` message ` argument can contain data that JSON is not able
10231023to represent.
1024- See [ Advanced Serialization ] [ ] for more details.
1024+ See [ Advanced serialization ] [ ] for more details.
10251025
10261026### ` subprocess.channel `
10271027<!-- YAML
@@ -1520,21 +1520,21 @@ This impacts output that includes multibyte character encodings such as UTF-8 or
15201520UTF-16. For instance, ` console.log('中文测试') ` will send 13 UTF-8 encoded bytes
15211521to ` stdout ` although there are only 4 characters.
15221522
1523- ## Shell Requirements
1523+ ## Shell requirements
15241524
15251525The shell should understand the ` -c ` switch. If the shell is ` 'cmd.exe' ` , it
15261526should understand the ` /d /s /c ` switches and command line parsing should be
15271527compatible.
15281528
1529- ## Default Windows Shell
1529+ ## Default Windows shell
15301530
15311531Although Microsoft specifies ` %COMSPEC% ` must contain the path to
15321532` 'cmd.exe' ` in the root environment, child processes are not always subject to
15331533the same requirement. Thus, in ` child_process ` functions where a shell can be
15341534spawned, ` 'cmd.exe' ` is used as a fallback if ` process.env.ComSpec ` is
15351535unavailable.
15361536
1537- ## Advanced Serialization
1537+ ## Advanced serialization
15381538<!-- YAML
15391539added: v12.16.0
15401540-->
@@ -1553,7 +1553,7 @@ Therefore, this feature requires opting in by setting the
15531553` serialization ` option to ` 'advanced' ` when calling [ ` child_process.spawn() ` ] [ ]
15541554or [ ` child_process.fork() ` ] [ ] .
15551555
1556- [ Advanced Serialization ] : #child_process_advanced_serialization
1556+ [ Advanced serialization ] : #child_process_advanced_serialization
15571557[ `'disconnect'` ] : process.html#process_event_disconnect
15581558[ `'error'` ] : #child_process_event_error
15591559[ `'exit'` ] : #child_process_event_exit
@@ -1586,8 +1586,8 @@ or [`child_process.fork()`][].
15861586[ `subprocess.stdio` ] : #child_process_subprocess_stdio
15871587[ `subprocess.stdout` ] : #child_process_subprocess_stdout
15881588[ `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
15901590[ 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
15921592[ synchronous counterparts ] : #child_process_synchronous_process_creation
15931593[ v8.serdes ] : v8.html#v8_serialization_api
0 commit comments