substream-on-active

2.0.0 • Public • Published

substream-on-active

Takes a long-lived mostly idle ReadableStream and creates short-lived childStreams for every period of activity. Each childStream will end when the parentStream goes idle again.

const substreamOnActive = require('substream-on-active')

substreamOnActive(readableStream, { delay: 1000 }, (childStream) => {
  console.log('new stream activity!')
  // childStream.pipe(somewhere)
})

Readme

Keywords

none

Package Sidebar

Install

npm i substream-on-active

Weekly Downloads

3

Version

2.0.0

License

ISC

Unpacked Size

4.29 kB

Total Files

4

Last publish

Collaborators

  • kumavis