OptimusPrime
NodeJS stream transformer
Install
Using Yarn:
yarn add optimus-prime-stream
Or using npm:
npm install --save optimus-prime-stream
API
The module exposes a single function with signature (Stream input, Function transformer) => Stream output
:
- input: The stream to read from.
- transformer: The function that transforms each chunk in the input stream.
Returns: A new stream with the transformed data.
Basic usage
Using transform to filter out the data you need from a stream:
// 1. require the packageconst transform = ; // 2. fetch a streamconst items = ; // 3. get the transformed streamconst names = ;