@@ -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
@@ -314,9 +313,9 @@ async function getVersion() {
314
313
getVersion ();
315
314
```
316
315
317
- * Note * : If the ` shell ` option is enabled, do not pass unsanitized user input
318
- to this function. Any input containing shell metacharacters may be used to
319
- trigger arbitrary command execution.
316
+ ** If the ` shell ` option is enabled, do not pass unsanitized user input to this
317
+ function. Any input containing shell metacharacters may be used to trigger
318
+ arbitrary command execution.**
320
319
321
320
### child_process.fork(modulePath[ , args] [ , options ] )
322
321
<!-- YAML
@@ -374,11 +373,11 @@ Node.js processes launched with a custom `execPath` will communicate with the
374
373
parent process using the file descriptor (fd) identified using the
375
374
environment variable ` NODE_CHANNEL_FD ` on the child process.
376
375
377
- * Note * : Unlike the fork(2) POSIX system call, ` child_process.fork() ` does
378
- not clone the current process.
376
+ Unlike the fork(2) POSIX system call, ` child_process.fork() ` does not clone the
377
+ current process.
379
378
380
- * Note * : The ` shell ` option available in [ ` child_process.spawn() ` ] [ ] is not
381
- supported by ` child_process.fork() ` and will be ignored if set.
379
+ The ` shell ` option available in [ ` child_process.spawn() ` ] [ ] is not supported by
380
+ ` child_process.fork() ` and will be ignored if set.
382
381
383
382
### child_process.spawn(command[ , args] [ , options ] )
384
383
<!-- YAML
@@ -424,9 +423,9 @@ The `child_process.spawn()` method spawns a new process using the given
424
423
` command ` , with command line arguments in ` args ` . If omitted, ` args ` defaults
425
424
to an empty array.
426
425
427
- * Note * : If the ` shell ` option is enabled, do not pass unsanitized user input to
428
- this function. Any input containing shell metacharacters may be used to
429
- trigger arbitrary command execution.
426
+ ** If the ` shell ` option is enabled, do not pass unsanitized user input to this
427
+ function. Any input containing shell metacharacters may be used to trigger
428
+ arbitrary command execution.**
430
429
431
430
A third argument may be used to specify additional options, with these defaults:
432
431
@@ -513,12 +512,12 @@ subprocess.on('error', (err) => {
513
512
});
514
513
```
515
514
516
- * Note * : Certain platforms (macOS, Linux) will use the value of ` argv[0] ` for
517
- the process title while others (Windows, SunOS) will use ` command ` .
515
+ Certain platforms (macOS, Linux) will use the value of ` argv[0] ` for the process
516
+ title while others (Windows, SunOS) will use ` command ` .
518
517
519
- * Note * : Node.js currently overwrites ` argv[0] ` with ` process.execPath ` on
520
- startup, so ` process.argv[0] ` in a Node.js child process will not match the
521
- ` argv0 ` parameter passed to ` spawn ` from the parent, retrieve it with the
518
+ Node.js currently overwrites ` argv[0] ` with ` process.execPath ` on startup, so
519
+ ` process.argv[0] ` in a Node.js child process will not match the ` argv0 `
520
+ parameter passed to ` spawn ` from the parent, retrieve it with the
522
521
` process.argv0 ` property instead.
523
522
524
523
#### 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