1.0.0 • Published 3 years ago

resumer-through2 v1.0.0

Weekly downloads
58
License
MIT
Repository
github
Last release
3 years ago

resumer-through2

Return a through2 stream that starts out paused and resumes on the next tick, unless somebody called .pause().

This module has the same signature as through2.

browser support

example

var resumer = require('resumer-through2');
var s = createStream();
s.pipe(process.stdout);

function createStream () {
    var stream = resumer();
    stream.push('beep boop\n');
    return stream;
}
$ node example/resume.js
beep boop

methods

var resumer = require('resumer-through2')

resumer(options, write, flush)

Return a new through2 stream from options, write and end, which default to pass-through .queue() functions if not specified.

The stream starts out paused and will be resumed on the next tick unless you call .pause() first.

options, write and end get passed directly through to through2.

install

With npm do:

npm install resumer-through2

license

This source code is based on resumer which does the same job for through as this does of through2.

MIT