Skip to content

Commit

Permalink
doc: add stream/promises pipeline and finished to doc and end to Pipe…
Browse files Browse the repository at this point in the history
…lineOptions
  • Loading branch information
marco-ippolito committed Dec 12, 2022
1 parent ef8aa88 commit 9538140
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions deps/undici/src/types/dispatcher.d.ts
Expand Up @@ -142,6 +142,9 @@ declare namespace Dispatcher {
export interface PipelineOptions extends RequestOptions {
/** `true` if the `handler` will return an object stream. Default: `false` */
objectMode?: boolean;
// https://github.com/nodejs/node/issues/34805#issuecomment-1345655205
/** Default: `false` */
end?: boolean;
}
export interface UpgradeOptions {
path: string;
Expand Down
28 changes: 28 additions & 0 deletions doc/api/stream.md
Expand Up @@ -59,6 +59,34 @@ functions for streams that return `Promise` objects rather than using
callbacks. The API is accessible via `require('node:stream/promises')`
or `require('node:stream').promises`.

### `stream.pipeline(source[, ...transforms], destination, options)`

### `stream.pipeline(streams, options)`

* `streams` {Stream\[]|Iterable\[]|AsyncIterable\[]|Function\[]}
* `source` {Stream|Iterable|AsyncIterable|Function}
* Returns: {Promise\<Iterable|AsyncIterable>}
* `...transforms` {Stream|Function}
* `source` {AsyncIterable}
* Returns: {Promise<AsyncIterable>}
* `destination` {Stream|Function}
* `source` {AsyncIterable}
* Returns: {Promise<AsyncIterable>}
* `options` {Object}
* `signal` {AbortSignal}
* `end` {boolean}
* Returns: {Promise<void>}

### `stream.finished(stream, options)`

* `stream` {Stream}
* `options` {Object}
* `error` {boolean|undefined}
* `readable` {boolean|undefined}
* `writable` {boolean|undefined}
* `signal`: {AbortSignal|undefined}
* Returns: {Promise<void>}

### Object mode

All streams created by Node.js APIs operate exclusively on strings and `Buffer`
Expand Down

0 comments on commit 9538140

Please sign in to comment.