npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

through-timeout

1.0.0

@juliangruber

npmHomeRepoSnykSocket
Downloads:5
$ npm install through-timeout
DailyWeeklyMonthlyYearly

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