Pause a stream's data events
JavaScript
Latest commit 7d13bb2 May 21, 2016 @dougwilson dougwilson build: istanbul@0.4.3
Failed to load latest commit information.
test lint: use standard style May 20, 2016
.eslintignore
.eslintrc
.gitignore
.travis.yml build: support Node.js 6.x May 20, 2016
HISTORY.md 0.1.0 Jul 1, 2015
LICENSE Refactor internals Jun 30, 2015
README.md build: add test coverage reporting Jul 1, 2015
index.js
package.json build: istanbul@0.4.3 May 21, 2016

README.md

pause

NPM Version NPM Downloads Node.js Version Build Status Test Coverage

Pause a stream's data events

Installation

$ npm install pause

API

var pause = require('pause')

handle = pause(stream)

Pause the data events on a stream and return a handle to resume or end the stream.

handle.end()

Dispose of the handle. This does not end the stream, but it simply discards the event collection, making handle.resume() a no-op.

handle.resume()

Resume the stream by re-emitting all the data events in the same order, followed by an end event, if that was emitting during the pause.

License

MIT