HeartBeat Stream
HeartBeat stream will slow down chunks when number of them is below bufferSize.
constructor (inherits from Duplex) takes object with following options:
- bufferSize - threshold of items
- delay - each element below will be emitted with every
delay
milliseconds
Usage
const readableStream = /*...*/const writeStream = /*...*/const heartBeatStream = bufferSize: 1000 delay: 1000 readableStream