heartbeat-stream

1.0.1 • Public • Published

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 = new HeartBeatStream({ bufferSize: 1000, delay: 1000 })
 
readableStream
    .pipe(heartBeatStream)
    .pipe(writeStream)

Build Status

Build Status

Package Sidebar

Install

npm i heartbeat-stream

Weekly Downloads

1

Version

1.0.1

License

GPL-3.0

Unpacked Size

12.6 kB

Total Files

10

Last publish

Collaborators

  • fixit