Transform Streams

A Transform stream extends the Duplex stream but modifies the data between the Writable stream and the Readable stream. This stream type can be extremely useful when you need to modify data from one system to another. Some examples of Transform streams are:

Image zlib stream

Image crypto streams

A major difference between the Duplex and the Transform streams is that for Transform streams, you do not need to implement the _read() and _write() prototype methods. These are provided as pass-through functions. Instead, you implement the _transform(chunk, ...

Get Node.js, MongoDB, and AngularJS Web Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.