Stream

Stream API

A stream is an abstract interface for working with streaming data, and is based on generators and async-iterators.

Methods

(static) compose(…targets)

Combines two or more streams into a Duplex stream.

Source:
Parameters:
Name Type Attributes Description
targets AsyncGeneratorFunction <repeatable>

A series of streams to be combined into the Duplex stream.

Returns:

AsyncGeneratorFunction - The combined Duplex stream.

(static) pipeline(source, …targets) → {Promise}

A module method to pipe between streams forwarding errors and properly cleaning up.

Source:
Parameters:
Name Type Attributes Description
source AsyncGeneratorFunction | AsyncIterator

The source stream from which data is read.

targets AsyncGeneratorFunction <repeatable>

One or more target streams where data from the source is written to.

Returns:
Type:
Promise