through-timeout
v1.0.0
Published
Through stream that calls a cb when no data has been written after the first x seconds
Readme
through-timeout
Through stream that calls a cb when no data has been written after the first x seconds.
Example
var Timeout = require('through-timeout');
source
.pipe(Timeout({
objectMode: true,
duration: 10000
}, function () {
// oh no!
source.destroy();
}))
.pipe(destination);API
Timeout({ duration, objectMode=false }, cb)
License
MIT
