Skip to content

Commit

Permalink
doc: clarify subprocess.stdout/in/err/io properties
Browse files Browse the repository at this point in the history
The various `subprocess.stdwhatever` properties can be null or
undefined in certain conditions.

Fixes: #33458
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: #36784
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
jasnell authored and targos committed May 1, 2021
1 parent 19e6120 commit c1ea23c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/api/child_process.md
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c1ea23c

Please sign in to comment.