summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2016-05-23 16:21:54 +0200
committerAnna Henningsen <anna@addaleax.net>2016-05-27 04:29:31 +0200
commit27d2267066add18a1eafa2ac852ffdb4ae3198be (patch)
tree5f7d4be14819956e7defe4fccc42ed0715073939 /doc
parentdbdea02a993f7fc40bccdac8a6eec47c67a37a3b (diff)
downloadandroid-node-v8-27d2267066add18a1eafa2ac852ffdb4ae3198be.tar.gz
android-node-v8-27d2267066add18a1eafa2ac852ffdb4ae3198be.tar.bz2
android-node-v8-27d2267066add18a1eafa2ac852ffdb4ae3198be.zip
doc: add `added:` information for child_process
Ref: https://github.com/nodejs/node/issues/6578 PR-URL: https://github.com/nodejs/node/pull/6927 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/child_process.md73
1 files changed, 71 insertions, 2 deletions
diff --git a/doc/api/child_process.md b/doc/api/child_process.md
index 1d79d16c1b..f06b6889b2 100644
--- a/doc/api/child_process.md
+++ b/doc/api/child_process.md
@@ -113,6 +113,9 @@ exec('my.bat', (err, stdout, stderr) => {
```
### child_process.exec(command[, options][, callback])
+<!-- YAML
+added: v0.1.90
+-->
* `command` {String} The command to run, with space-separated arguments
* `options` {Object}
@@ -186,6 +189,9 @@ child runs longer than `timeout` milliseconds.
replace the existing process and uses a shell to execute the command.*
### child_process.execFile(file[, args][, options][, callback])
+<!-- YAML
+added: v0.1.91
+-->
* `file` {String} The name or path of the executable file to run
* `args` {Array} List of string arguments
@@ -231,6 +237,9 @@ stderr output. If `encoding` is `'buffer'`, `Buffer` objects will be passed to
the callback instead.
### child_process.fork(modulePath[, args][, options])
+<!-- YAML
+added: v0.5.0
+-->
* `modulePath` {String} The module to run in the child
* `args` {Array} List of string arguments
@@ -275,6 +284,9 @@ output on this fd is expected to be line delimited JSON objects.
not clone the current process.*
### child_process.spawn(command[, args][, options])
+<!-- YAML
+added: v0.1.90
+-->
* `command` {String} The command to run
* `args` {Array} List of string arguments
@@ -384,6 +396,9 @@ child.on('error', (err) => {
```
#### options.detached
+<!-- YAML
+added: v0.7.10
+-->
On Windows, setting `options.detached` to `true` makes it possible for the
child process to continue running after the parent exits. The child will have
@@ -438,6 +453,9 @@ child.unref();
```
#### options.stdio
+<!-- YAML
+added: v0.7.10
+-->
The `options.stdio` option is used to configure the pipes that are established
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
configuration at startup.
### child_process.execFileSync(file[, args][, options])
+<!-- YAML
+added: v0.11.12
+-->
* `file` {String} The name or path of the executable file to run
* `args` {Array} List of string arguments
@@ -560,6 +581,9 @@ throw. The [`Error`][] object will contain the entire result from
[`child_process.spawnSync()`][]
### child_process.execSync(command[, options])
+<!-- YAML
+added: v0.11.12
+-->
* `command` {String} The command to run
* `options` {Object}
@@ -600,6 +624,9 @@ throw. The [`Error`][] object will contain the entire result from
[`child_process.spawnSync()`][]
### child_process.spawnSync(command[, args][, options])
+<!-- YAML
+added: v0.11.12
+-->
* `command` {String} The command to run
* `args` {Array} List of string arguments
@@ -642,6 +669,9 @@ completely exited. Note that if the process intercepts and handles the
process has exited.
## Class: ChildProcess
+<!-- YAML
+added: v2.2.0
+-->
Instances of the `ChildProcess` class are [`EventEmitters`][`EventEmitter`] that represent
spawned child processes.
@@ -652,6 +682,9 @@ use the [`child_process.spawn()`][], [`child_process.exec()`][],
instances of `ChildProcess`.
### Event: 'close'
+<!-- YAML
+added: v0.7.7
+-->
* `code` {Number} the exit code if the child exited on its own.
* `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
processes might share the same stdio streams.
### Event: 'disconnect'
+<!-- YAML
+added: v0.7.2
+-->
The `'disconnect'` event is emitted after calling the
[`child.disconnect()`][] method in parent process or [`process.disconnect()`][] in child process. After
disconnecting it is no longer possible to send or receive messages, and the
[`child.connected`][] property is `false`.
-### Event: 'error'
+### Event: 'error'
* `err` {Error} the error.
@@ -683,7 +719,10 @@ to guard against accidentally invoking handler functions multiple times.
See also [`child.kill()`][] and [`child.send()`][].
-### Event: 'exit'
+### Event: 'exit'
+<!-- YAML
+added: v0.1.90
+-->
* `code` {Number} the exit code if the child exited on its own.
* `signal` {String} the signal by which the child process was terminated.
@@ -704,6 +743,9 @@ and then will re-raise the handled signal.
See waitpid(2).
### Event: 'message'
+<!-- YAML
+added: v0.5.9
+-->
* `message` {Object} a parsed JSON object or primitive value.
* `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()`][
to send messages.
### child.connected
+<!-- YAML
+added: v0.7.2
+-->
* {Boolean} Set to `false` after `child.disconnect()` is called
@@ -721,6 +766,9 @@ and receive messages from a child process. When `child.connected` is `false`, it
is no longer possible to send or receive messages.
### child.disconnect()
+<!-- YAML
+added: v0.7.2
+-->
Closes the IPC channel between parent and child, allowing the child to exit
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
within the child process to close the IPC channel as well.
### child.kill([signal])
+<!-- YAML
+added: v0.1.90
+-->
* `signal` {String}
@@ -791,6 +842,9 @@ setTimeout(() => {
```
### child.pid
+<!-- YAML
+added: v0.1.90
+-->
* {Number} Integer
@@ -807,6 +861,9 @@ grep.stdin.end();
```
### child.send(message[, sendHandle[, options]][, callback])
+<!-- YAML
+added: v0.5.9
+-->
* `message` {Object}
* `sendHandle` {Handle}
@@ -962,6 +1019,9 @@ this occurs.
`message`.*
### child.stderr
+<!-- YAML
+added: v0.1.90
+-->
* {Stream}
@@ -974,6 +1034,9 @@ then this will be `undefined`.
the same value.
### child.stdin
+<!-- YAML
+added: v0.1.90
+-->
* {Stream}
@@ -989,6 +1052,9 @@ then this will be `undefined`.
the same value.
### child.stdio
+<!-- YAML
+added: v0.7.10
+-->
* {Array}
@@ -1026,6 +1092,9 @@ assert.equal(child.stdio[2], child.stderr);
```
### child.stdout
+<!-- YAML
+added: v0.1.90
+-->
* {Stream}