| 1 |
# resumer |
| 2 |
|
| 3 |
Return a through stream that starts out paused and resumes on the next tick, |
| 4 |
unless somebody called `.pause()`. |
| 5 |
|
| 6 |
This module has the same signature as |
| 7 |
[through](https://npmjs.com/package/through). |
| 8 |
|
| 9 |
[](http://ci.testling.com/substack/resumer) |
| 10 |
|
| 11 |
[](http://travis-ci.org/substack/resumer) |
| 12 |
|
| 13 |
# example |
| 14 |
|
| 15 |
``` js |
| 16 |
var resumer = require('resumer'); |
| 17 |
var s = createStream(); |
| 18 |
s.pipe(process.stdout); |
| 19 |
|
| 20 |
function createStream () { |
| 21 |
var stream = resumer(); |
| 22 |
stream.queue('beep boop\n'); |
| 23 |
return stream; |
| 24 |
} |
| 25 |
``` |
| 26 |
|
| 27 |
``` |
| 28 |
$ node example/resume.js |
| 29 |
beep boop |
| 30 |
``` |
| 31 |
|
| 32 |
# methods |
| 33 |
|
| 34 |
``` js |
| 35 |
var resumer = require('resumer') |
| 36 |
``` |
| 37 |
|
| 38 |
## resumer(write, end) |
| 39 |
|
| 40 |
Return a new through stream from `write` and `end`, which default to |
| 41 |
pass-through `.queue()` functions if not specified. |
| 42 |
|
| 43 |
The stream starts out paused and will be resumed on the next tick unless you |
| 44 |
call `.pause()` first. |
| 45 |
|
| 46 |
`write` and `end` get passed directly through to |
| 47 |
[through](https://npmjs.com/package/through). |
| 48 |
|
| 49 |
# install |
| 50 |
|
| 51 |
With [npm](https://npmjs.org) do: |
| 52 |
|
| 53 |
``` |
| 54 |
npm install resumer |
| 55 |
``` |
| 56 |
|
| 57 |
# license |
| 58 |
|
| 59 |
MIT |