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 <[email protected]>

PR-URL: #36784
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
jasnell authored and danielleadams committed Jan 12, 2021
1 parent 4e4deca commit d4bcb36
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d4bcb36

Please sign in to comment.