Transform stream

A Duplex stream that changes data as it passes through, such as a compressor, a cipher or a packet parser.

In more detail

A custom one implements _transform(chunk, encoding, callback) to push results and call the callback, and optionally _flush(callback) to emit anything left over when the input ends. It respects backpressure on both sides automatically.

Related terms

Taught in

References