Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+13 added−1 removed
other:+13 added−1 removed
Provenance
Commit
6ad1a6e
Tree
0514b36
Author
ehmicky <ehmicky@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Parent
1796805
2 files changed+13 added−1 removed
modified:docs/input.md+12 added
110 unmodified lines
Expand all
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
12 unmodified lines
110 unmodified lines
Expand all
const ipcInput = await getOneMessage();
```
## Multiple inputs
The input can come from multiple sources by setting the [`stdin`](api.md#optionsstdin) option to an array of values. Alternatively the [`input`](api.md#optionsinput), [`inputFile`](api.md#optionsinputfile) and [`stdin`](api.md#optionsstdin) options can be combined.
The following example redirects `stdin` from both the [terminal](#terminal-input) and an `input.txt` [file](#file-input).
```js
await execa({stdin: ['inherit', {file: 'input.txt'}]})`npm run scaffold`;
```
__Loss of TTY control:__ Please note that when a file descriptor is configured with a combination of `'inherit'` and other values, this file descriptor will never refer to a TTY in the subprocess, even if in the current process it does.
## Additional file descriptors
The [`stdio`](api.md#optionsstdio) option can be used to pass some input to any [file descriptor](https://en.wikipedia.org/wiki/File_descriptor), as opposed to only [`stdin`](api.md#optionsstdin).
12 unmodified lines
modified:docs/output.md+1 added-1 removed
84 unmodified lines
85```8687## Multiple targets8889-The output can be redirected to multiple targets by setting the [`stdout`](api.md#optionsstdout) or [`stderr`](api.md#optionsstderr) option to an array of values. This also allows specifying multiple inputs with the [`stdin`](api.md#optionsstdin) option.89+The output can be redirected to multiple targets by setting the [`stdout`](api.md#optionsstdout) or [`stderr`](api.md#optionsstderr) option to an array of values.9091The following example redirects `stdout` to both the [terminal](#terminal-output) and an `output.txt` [file](#file-output), while also retrieving its value [programmatically](#stdout-and-stderr).9293```js