Skip to content
This repository has been archived by the owner on Nov 9, 2019. It is now read-only.

dominictarr/pause-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PauseStream

This is a Stream that will strictly buffer when paused. Connect it to anything you need buffered.

  var ps = require('pause-stream')();

  badlyBehavedStream.pipe(ps.pause())

  aLittleLater(function (err, data) {
    ps.pipe(createAnotherStream(data))
    ps.resume()
  })

PauseStream will buffer whenever paused. it will buffer when yau have called pause manually. but also when it's downstream dest.write()===false. it will attempt to drain the buffer when you call resume or the downstream emits 'drain'

PauseStream is tested using stream-spec and stream-tester

This is now the default case of through

https://github.com/dominictarr/pause-stream/commit/4a6fe3dc2c11091b1efbfde912e0473719ed9cc0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published