From 0eee704db5154fa78b2c7a490d07fcd4d478bacd Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Mon, 12 Dec 2022 19:48:43 +0100 Subject: [PATCH] doc: add stream/promises pipeline and finished to doc and end to PipelineOptions --- doc/api/stream.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/doc/api/stream.md b/doc/api/stream.md index 1726635b55b9d4..25fd83a3f486fc 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -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\} +* `...transforms` {Stream|Function} + * `source` {AsyncIterable} + * Returns: {Promise} +* `destination` {Stream|Function} + * `source` {AsyncIterable} + * Returns: {Promise} +* `options` {Object} + * `signal` {AbortSignal} + * `end` {boolean} +* Returns: {Promise} + +### `stream.finished(stream, options)` + +* `stream` {Stream} +* `options` {Object} + * `error` {boolean|undefined} + * `readable` {boolean|undefined} + * `writable` {boolean|undefined} + * `signal`: {AbortSignal|undefined} +* Returns: {Promise} + ### Object mode All streams created by Node.js APIs operate exclusively on strings and `Buffer`