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 Danielle Adams committed 2021-01-12 07:10:48 -05:00
1 parent 4e4deca90d
commit d4bcb3689d
1 file changed
+12
+12
View File
@@ -1508,6 +1508,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
@@ -1526,6 +1529,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
@@ -1566,6 +1572,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
@@ -1591,6 +1600,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