1.0.0 • Published 7 years ago

throttle-obj-stream v1.0.0

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

throttle-obj-stream

an object stream that uses lodash.throttle to reduce the number of events passing through the stream.

example

reduces the number of messages sent from some noisyStream to stdout down to max 1/sec.

const throttleStream = require('throttle-obj-stream')
const pump = require('pump')

pump(
  noisyStream,
  throttleStream(1000),
  process.stdout,
  (err) => console.log('pipeline ended', err)
)