Node.js Stream API
The main module exported by the package is a native Node.js Transform stream. Transform streams implement both the Readable and Writable interfaces.
This is the recommended approach if you need a maximum of power. It ensures scalability by treating your data as a stream from the source to the destination and support all the options available.
The signature is const stream = transform(records, [options], handler, [options], [callback])
.
Both a readable and writable stream
In the stream example, records in the form of an array are sent through the write
function and the transformed records are obtained within the "readable" event by calling the read
function.
This example is available with the command node samples/api.stream.js
.