Skip to content

Commit 5fd643b

Browse files
addaleaxFishrock123
authored andcommittedMay 30, 2016
doc: add added: information for child_process
Ref: nodejs#6578 PR-URL: nodejs#6927 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent bcbe962 commit 5fd643b

File tree

1 file changed

+71
-2
lines changed

1 file changed

+71
-2
lines changed
 

‎doc/api/child_process.md

+71-2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ exec('my.bat', (err, stdout, stderr) => {
113113
```
114114

115115
### child_process.exec(command[, options][, callback])
116+
<!-- YAML
117+
added: v0.1.90
118+
-->
116119

117120
* `command` {String} The command to run, with space-separated arguments
118121
* `options` {Object}
@@ -186,6 +189,9 @@ child runs longer than `timeout` milliseconds.
186189
replace the existing process and uses a shell to execute the command.*
187190

188191
### child_process.execFile(file[, args][, options][, callback])
192+
<!-- YAML
193+
added: v0.1.91
194+
-->
189195

190196
* `file` {String} The name or path of the executable file to run
191197
* `args` {Array} List of string arguments
@@ -231,6 +237,9 @@ stderr output. If `encoding` is `'buffer'`, `Buffer` objects will be passed to
231237
the callback instead.
232238

233239
### child_process.fork(modulePath[, args][, options])
240+
<!-- YAML
241+
added: v0.5.0
242+
-->
234243

235244
* `modulePath` {String} The module to run in the child
236245
* `args` {Array} List of string arguments
@@ -275,6 +284,9 @@ output on this fd is expected to be line delimited JSON objects.
275284
not clone the current process.*
276285

277286
### child_process.spawn(command[, args][, options])
287+
<!-- YAML
288+
added: v0.1.90
289+
-->
278290

279291
* `command` {String} The command to run
280292
* `args` {Array} List of string arguments
@@ -384,6 +396,9 @@ child.on('error', (err) => {
384396
```
385397

386398
#### options.detached
399+
<!-- YAML
400+
added: v0.7.10
401+
-->
387402

388403
On Windows, setting `options.detached` to `true` makes it possible for the
389404
child process to continue running after the parent exits. The child will have
@@ -438,6 +453,9 @@ child.unref();
438453
```
439454

440455
#### options.stdio
456+
<!-- YAML
457+
added: v0.7.10
458+
-->
441459

442460
The `options.stdio` option is used to configure the pipes that are established
443461
between the parent and child process. By default, the child's stdin, stdout,
@@ -524,6 +542,9 @@ scripting tasks and for simplifying the loading/processing of application
524542
configuration at startup.
525543

526544
### child_process.execFileSync(file[, args][, options])
545+
<!-- YAML
546+
added: v0.11.12
547+
-->
527548

528549
* `file` {String} The name or path of the executable file to run
529550
* `args` {Array} List of string arguments
@@ -560,6 +581,9 @@ throw. The [`Error`][] object will contain the entire result from
560581
[`child_process.spawnSync()`][]
561582

562583
### child_process.execSync(command[, options])
584+
<!-- YAML
585+
added: v0.11.12
586+
-->
563587

564588
* `command` {String} The command to run
565589
* `options` {Object}
@@ -600,6 +624,9 @@ throw. The [`Error`][] object will contain the entire result from
600624
[`child_process.spawnSync()`][]
601625

602626
### child_process.spawnSync(command[, args][, options])
627+
<!-- YAML
628+
added: v0.11.12
629+
-->
603630

604631
* `command` {String} The command to run
605632
* `args` {Array} List of string arguments
@@ -642,6 +669,9 @@ completely exited. Note that if the process intercepts and handles the
642669
process has exited.
643670

644671
## Class: ChildProcess
672+
<!-- YAML
673+
added: v2.2.0
674+
-->
645675

646676
Instances of the `ChildProcess` class are [`EventEmitters`][`EventEmitter`] that represent
647677
spawned child processes.
@@ -652,6 +682,9 @@ use the [`child_process.spawn()`][], [`child_process.exec()`][],
652682
instances of `ChildProcess`.
653683

654684
### Event: 'close'
685+
<!-- YAML
686+
added: v0.7.7
687+
-->
655688

656689
* `code` {Number} the exit code if the child exited on its own.
657690
* `signal` {String} the signal by which the child process was terminated.
@@ -661,13 +694,16 @@ been closed. This is distinct from the [`'exit'`][] event, since multiple
661694
processes might share the same stdio streams.
662695

663696
### Event: 'disconnect'
697+
<!-- YAML
698+
added: v0.7.2
699+
-->
664700

665701
The `'disconnect'` event is emitted after calling the
666702
[`child.disconnect()`][] method in parent process or [`process.disconnect()`][] in child process. After
667703
disconnecting it is no longer possible to send or receive messages, and the
668704
[`child.connected`][] property is `false`.
669705

670-
### Event: 'error'
706+
### Event: 'error'
671707

672708
* `err` {Error} the error.
673709

@@ -683,7 +719,10 @@ to guard against accidentally invoking handler functions multiple times.
683719

684720
See also [`child.kill()`][] and [`child.send()`][].
685721

686-
### Event: 'exit'
722+
### Event: 'exit'
723+
<!-- YAML
724+
added: v0.1.90
725+
-->
687726

688727
* `code` {Number} the exit code if the child exited on its own.
689728
* `signal` {String} the signal by which the child process was terminated.
@@ -704,6 +743,9 @@ and then will re-raise the handled signal.
704743
See waitpid(2).
705744

706745
### Event: 'message'
746+
<!-- YAML
747+
added: v0.5.9
748+
-->
707749

708750
* `message` {Object} a parsed JSON object or primitive value.
709751
* `sendHandle` {Handle} a [`net.Socket`][] or [`net.Server`][] object, or
@@ -713,6 +755,9 @@ The `'message'` event is triggered when a child process uses [`process.send()`][
713755
to send messages.
714756

715757
### child.connected
758+
<!-- YAML
759+
added: v0.7.2
760+
-->
716761

717762
* {Boolean} Set to `false` after `child.disconnect()` is called
718763

@@ -721,6 +766,9 @@ and receive messages from a child process. When `child.connected` is `false`, it
721766
is no longer possible to send or receive messages.
722767

723768
### child.disconnect()
769+
<!-- YAML
770+
added: v0.7.2
771+
-->
724772

725773
Closes the IPC channel between parent and child, allowing the child to exit
726774
gracefully once there are no other connections keeping it alive. After calling
@@ -737,6 +785,9 @@ Note that when the child process is a Node.js instance (e.g. spawned using
737785
within the child process to close the IPC channel as well.
738786

739787
### child.kill([signal])
788+
<!-- YAML
789+
added: v0.1.90
790+
-->
740791

741792
* `signal` {String}
742793

@@ -791,6 +842,9 @@ setTimeout(() => {
791842
```
792843

793844
### child.pid
845+
<!-- YAML
846+
added: v0.1.90
847+
-->
794848

795849
* {Number} Integer
796850

@@ -807,6 +861,9 @@ grep.stdin.end();
807861
```
808862

809863
### child.send(message[, sendHandle[, options]][, callback])
864+
<!-- YAML
865+
added: v0.5.9
866+
-->
810867

811868
* `message` {Object}
812869
* `sendHandle` {Handle}
@@ -962,6 +1019,9 @@ this occurs.
9621019
`message`.*
9631020

9641021
### child.stderr
1022+
<!-- YAML
1023+
added: v0.1.90
1024+
-->
9651025

9661026
* {Stream}
9671027

@@ -974,6 +1034,9 @@ then this will be `undefined`.
9741034
the same value.
9751035

9761036
### child.stdin
1037+
<!-- YAML
1038+
added: v0.1.90
1039+
-->
9771040

9781041
* {Stream}
9791042

@@ -989,6 +1052,9 @@ then this will be `undefined`.
9891052
the same value.
9901053

9911054
### child.stdio
1055+
<!-- YAML
1056+
added: v0.7.10
1057+
-->
9921058

9931059
* {Array}
9941060

@@ -1026,6 +1092,9 @@ assert.equal(child.stdio[2], child.stderr);
10261092
```
10271093

10281094
### child.stdout
1095+
<!-- YAML
1096+
added: v0.1.90
1097+
-->
10291098

10301099
* {Stream}
10311100

0 commit comments

Comments
 (0)