doc: clarify subprocess.stdout/in/err/io properties

The various `subprocess.stdwhatever` properties can be null or
undefined in certain conditions.

Fixes: https://github.com/nodejs/node/issues/33458
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/36784
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
James M Snell authored and Michaël Zasso committed 2021-05-01 12:12:51 +02:00
1 parent 19e61206f2
commit c1ea23c55d
1 file changed
+12
+12
View File
@@ -1498,6 +1498,9 @@ then this will be `null`.
`subprocess.stderr` is an alias for `subprocess.stdio[2]`. Both properties will
refer to the same value.
The `subprocess.stderr` property can be `null` if the child process could
not be successfully spawned.
### `subprocess.stdin`
<!-- YAML
added: v0.1.90
@@ -1516,6 +1519,9 @@ then this will be `null`.
`subprocess.stdin` is an alias for `subprocess.stdio[0]`. Both properties will
refer to the same value.
The `subprocess.stdin` property can be `undefined` if the child process could
not be successfully spawned.
### `subprocess.stdio`
<!-- YAML
added: v0.7.10
@@ -1556,6 +1562,9 @@ assert.strictEqual(subprocess.stdio[2], null);
assert.strictEqual(subprocess.stdio[2], subprocess.stderr);
```
The `subprocess.stdio` property can be `undefined` if the child process could
not be successfully spawned.
### `subprocess.stdout`
<!-- YAML
added: v0.1.90
@@ -1581,6 +1590,9 @@ subprocess.stdout.on('data', (data) => {
});
```
The `subprocess.stdout` property can be `null` if the child process could
not be successfully spawned.
### `subprocess.unref()`
<!-- YAML
added: v0.7.10