@@ -170,9 +170,8 @@ exec('echo "The \\$HOME variable is $HOME"');
170
170
// The $HOME variable is escaped in the first instance, but not in the second
171
171
```
172
172
173
- * Note* : Never pass unsanitized user input to this function. Any input
174
- containing shell metacharacters may be used to trigger arbitrary command
175
- execution.
173
+ ** Never pass unsanitized user input to this function. Any input containing shell
174
+ metacharacters may be used to trigger arbitrary command execution.**
176
175
177
176
``` js
178
177
const { exec } = require (' child_process' );
@@ -218,8 +217,8 @@ If `timeout` is greater than `0`, the parent will send the signal
218
217
identified by the ` killSignal ` property (the default is ` 'SIGTERM' ` ) if the
219
218
child runs longer than ` timeout ` milliseconds.
220
219
221
- * Note * : Unlike the exec(3) POSIX system call, ` child_process.exec() ` does not
222
- replace the existing process and uses a shell to execute the command.
220
+ Unlike the exec(3) POSIX system call, ` child_process.exec() ` does not replace
221
+ the existing process and uses a shell to execute the command.
223
222
224
223
If this method is invoked as its [ ` util.promisify() ` ] [ ] ed version, it returns
225
224
a Promise for an object with ` stdout ` and ` stderr ` properties. In case of an
@@ -316,9 +315,9 @@ async function getVersion() {
316
315
getVersion ();
317
316
```
318
317
319
- * Note * : If the ` shell ` option is enabled, do not pass unsanitized user input
320
- to this function. Any input containing shell metacharacters may be used to
321
- trigger arbitrary command execution.
318
+ ** If the ` shell ` option is enabled, do not pass unsanitized user input to this
319
+ function. Any input containing shell metacharacters may be used to trigger
320
+ arbitrary command execution.**
322
321
323
322
### child_process.fork(modulePath[ , args] [ , options ] )
324
323
<!-- YAML
@@ -376,11 +375,11 @@ Node.js processes launched with a custom `execPath` will communicate with the
376
375
parent process using the file descriptor (fd) identified using the
377
376
environment variable ` NODE_CHANNEL_FD ` on the child process.
378
377
379
- * Note * : Unlike the fork(2) POSIX system call, ` child_process.fork() ` does
380
- not clone the current process.
378
+ Unlike the fork(2) POSIX system call, ` child_process.fork() ` does not clone the
379
+ current process.
381
380
382
- * Note * : The ` shell ` option available in [ ` child_process.spawn() ` ] [ ] is not
383
- supported by ` child_process.fork() ` and will be ignored if set.
381
+ The ` shell ` option available in [ ` child_process.spawn() ` ] [ ] is not supported by
382
+ ` child_process.fork() ` and will be ignored if set.
384
383
385
384
### child_process.spawn(command[ , args] [ , options ] )
386
385
<!-- YAML
@@ -426,9 +425,9 @@ The `child_process.spawn()` method spawns a new process using the given
426
425
` command ` , with command line arguments in ` args ` . If omitted, ` args ` defaults
427
426
to an empty array.
428
427
429
- * Note * : If the ` shell ` option is enabled, do not pass unsanitized user input to
430
- this function. Any input containing shell metacharacters may be used to
431
- trigger arbitrary command execution.
428
+ ** If the ` shell ` option is enabled, do not pass unsanitized user input to this
429
+ function. Any input containing shell metacharacters may be used to trigger
430
+ arbitrary command execution.**
432
431
433
432
A third argument may be used to specify additional options, with these defaults:
434
433
@@ -517,12 +516,12 @@ subprocess.on('error', (err) => {
517
516
});
518
517
```
519
518
520
- * Note * : Certain platforms (macOS, Linux) will use the value of ` argv[0] ` for
521
- the process title while others (Windows, SunOS) will use ` command ` .
519
+ Certain platforms (macOS, Linux) will use the value of ` argv[0] ` for the process
520
+ title while others (Windows, SunOS) will use ` command ` .
522
521
523
- * Note * : Node.js currently overwrites ` argv[0] ` with ` process.execPath ` on
524
- startup, so ` process.argv[0] ` in a Node.js child process will not match the
525
- ` argv0 ` parameter passed to ` spawn ` from the parent, retrieve it with the
522
+ Node.js currently overwrites ` argv[0] ` with ` process.execPath ` on startup, so
523
+ ` process.argv[0] ` in a Node.js child process will not match the ` argv0 `
524
+ parameter passed to ` spawn ` from the parent, retrieve it with the
526
525
` process.argv0 ` property instead.
527
526
528
527
#### options.detached
@@ -725,17 +724,17 @@ until the child process has fully closed. When a timeout has been encountered
725
724
and ` killSignal ` is sent, the method won't return until the process has
726
725
completely exited.
727
726
728
- * Note * : If the child process intercepts and handles the ` SIGTERM ` signal and
727
+ If the child process intercepts and handles the ` SIGTERM ` signal and
729
728
does not exit, the parent process will still wait until the child process has
730
729
exited.
731
730
732
731
If the process times out or has a non-zero exit code, this method *** will***
733
732
throw an [ ` Error ` ] [ ] that will include the full result of the underlying
734
733
[ ` child_process.spawnSync() ` ] [ ] .
735
734
736
- * Note * : If the ` shell ` option is enabled, do not pass unsanitized user input
737
- to this function. Any input containing shell metacharacters may be used to
738
- trigger arbitrary command execution.
735
+ ** If the ` shell ` option is enabled, do not pass unsanitized user input to this
736
+ function. Any input containing shell metacharacters may be used to trigger
737
+ arbitrary command execution.**
739
738
740
739
### child_process.execSync(command[ , options] )
741
740
<!-- YAML
@@ -789,9 +788,8 @@ If the process times out or has a non-zero exit code, this method ***will***
789
788
throw. The [ ` Error ` ] [ ] object will contain the entire result from
790
789
[ ` child_process.spawnSync() ` ] [ ]
791
790
792
- * Note* : Never pass unsanitized user input to this function. Any input
793
- containing shell metacharacters may be used to trigger arbitrary command
794
- execution.
791
+ ** Never pass unsanitized user input to this function. Any input containing shell
792
+ metacharacters may be used to trigger arbitrary command execution.**
795
793
796
794
### child_process.spawnSync(command[ , args] [ , options ] )
797
795
<!-- YAML
@@ -857,9 +855,9 @@ completely exited. Note that if the process intercepts and handles the
857
855
` SIGTERM ` signal and doesn't exit, the parent process will wait until the child
858
856
process has exited.
859
857
860
- * Note * : If the ` shell ` option is enabled, do not pass unsanitized user input
861
- to this function. Any input containing shell metacharacters may be used to
862
- trigger arbitrary command execution.
858
+ ** If the ` shell ` option is enabled, do not pass unsanitized user input to this
859
+ function. Any input containing shell metacharacters may be used to trigger
860
+ arbitrary command execution.**
863
861
864
862
## Class: ChildProcess
865
863
<!-- YAML
@@ -907,9 +905,9 @@ The `'error'` event is emitted whenever:
907
905
2 . The process could not be killed, or
908
906
3 . Sending a message to the child process failed.
909
907
910
- * Note * : The ` 'exit' ` event may or may not fire after an error has occurred.
911
- When listening to both the ` 'exit' ` and ` 'error' ` events, it is important
912
- to guard against accidentally invoking handler functions multiple times.
908
+ The ` 'exit' ` event may or may not fire after an error has occurred. When
909
+ listening to both the ` 'exit' ` and ` 'error' ` events, it is important to guard
910
+ against accidentally invoking handler functions multiple times.
913
911
914
912
See also [ ` subprocess.kill() ` ] [ ] and [ ` subprocess.send() ` ] [ ] .
915
913
@@ -948,7 +946,7 @@ added: v0.5.9
948
946
The ` 'message' ` event is triggered when a child process uses [ ` process.send() ` ] [ ]
949
947
to send messages.
950
948
951
- * Note * : The message goes through serialization and parsing. The resulting
949
+ The message goes through serialization and parsing. The resulting
952
950
message might not be the same as what is originally sent.
953
951
954
952
### subprocess.channel
@@ -1111,7 +1109,7 @@ be used to send messages to the child process. When the child process is a
1111
1109
Node.js instance, these messages can be received via the
1112
1110
[ ` process.on('message') ` ] [ ] event.
1113
1111
1114
- * Note * : The message goes through serialization and parsing. The resulting
1112
+ The message goes through serialization and parsing. The resulting
1115
1113
message might not be the same as what is originally sent.
1116
1114
1117
1115
For example, in the parent script:
0 commit comments