Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

pause

stream-utils14.5mMIT0.1.0TypeScript support: definitely-typed

Pause a stream's data events

readme

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

changelog

0.1.0 / 2015-07-01

  • Re-emit events with all original arguments
  • Refactor internals
  • perf: enable strict mode

0.0.1 / 2010-01-03

  • Initial release