diff --git a/index.d.ts b/index.d.ts index f29c6d2601..210299a245 100644 --- a/index.d.ts +++ b/index.d.ts @@ -321,6 +321,13 @@ declare namespace execa { Similar to [`childProcess.kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal). This is preferred when cancelling the child process execution as the error is more descriptive and [`childProcessResult.isCanceled`](#iscanceled) is set to `true`. */ cancel(): void; + + /** + Stream combining/interleaving [`stdout`](https://nodejs.org/api/child_process.html#child_process_subprocess_stdout) and [`stderr`](https://nodejs.org/api/child_process.html#child_process_subprocess_stderr). + + This is `undefined` when both `stdout` and `stderr` options are set to [`'pipe'`, `'ipc'`, `Stream` or `integer`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). + */ + all?: ReadableStream; } type ExecaChildProcess = ChildProcess & diff --git a/index.test-d.ts b/index.test-d.ts index 591ad5e5b9..0b3347c7c9 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -1,4 +1,5 @@ import {expectType, expectError} from 'tsd'; +import {Readable as ReadableStream} from 'stream' import execa = require('.'); import { ExecaReturnValue, @@ -11,6 +12,7 @@ import { try { const execaPromise = execa('unicorns'); execaPromise.cancel(); + expectType(execaPromise.all) const unicornsResult = await execaPromise; expectType(unicornsResult.command); diff --git a/readme.md b/readme.md index 8d111e8fc4..b5633f2af2 100644 --- a/readme.md +++ b/readme.md @@ -164,8 +164,12 @@ Similar to [`childProcess.kill()`](https://nodejs.org/api/child_process.html#chi #### all +Type: `ReadableStream | undefined` + Stream combining/interleaving [`stdout`](https://nodejs.org/api/child_process.html#child_process_subprocess_stdout) and [`stderr`](https://nodejs.org/api/child_process.html#child_process_subprocess_stderr). +This is `undefined` when both [`stdout`](#stdout-1) and [`stderr`](#stderr-1) options are set to [`'pipe'`, `'ipc'`, `Stream` or `integer`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). + ### execa.sync(file, [arguments], [options]) Execute a file synchronously.