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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.