mrr.sj.front/node_modules/pause-stream
丁杰 1aa732ad02 初始化商家app代码 2026-03-24 11:45:13 +08:00
..
test 初始化商家app代码 2026-03-24 11:45:13 +08:00
.npmignore 初始化商家app代码 2026-03-24 11:45:13 +08:00
LICENSE 初始化商家app代码 2026-03-24 11:45:13 +08:00
index.js 初始化商家app代码 2026-03-24 11:45:13 +08:00
package.json 初始化商家app代码 2026-03-24 11:45:13 +08:00
readme.markdown 初始化商家app代码 2026-03-24 11:45:13 +08:00

readme.markdown

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

4a6fe3dc2c