pause-stream
a ThroughStream that strictly buffers all readable events when paused.
Last updated 11 years ago by dominictarr .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install pause-stream 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.0.11                                ...           latest (11 years ago)

11 Versions

  • 0.0.11                                ...           11 years ago
  • 0.0.10                                ...           12 years ago
  • 0.0.9                                ...           12 years ago
  • 0.0.8                                ...           12 years ago
  • 0.0.7                                ...           12 years ago
  • 0.0.6                                ...           12 years ago
  • 0.0.5                                ...           12 years ago
  • 0.0.4                                ...           12 years ago
  • 0.0.3                                ...           12 years ago
  • 0.0.2                                ...           12 years ago
  • 0.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 6
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE