# pause-stream

> a ThroughStream that strictly buffers all readable events when paused.

Latest version **0.0.11** (published 2013-09-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install pause-stream
pnpm add pause-stream
yarn add pause-stream
bun add pause-stream
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.11 |
| Published | 2013-09-20 |
| First published | 2012-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 40 |
| Author | Dominic Tarr |
| Maintainers | dominictarr |
| Keywords | stream, pipe, pause, drain, buffer |

## Links

- npm: https://www.npmjs.com/package/pause-stream
- Repository: https://github.com/dominictarr/pause-stream
- Issues: https://github.com/dominictarr/pause-stream/issues
- npm.io page: https://npm.io/package/pause-stream

## Dependencies (1)

- [through](https://npm.io/package/through.md) ~2.3

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 0.0.11 (latest) — 2013-09-20
- 0.0.10 — 2013-04-22
- 0.0.9 — 2013-02-05
- 0.0.8 — 2013-02-05
- 0.0.7 — 2013-01-27
- 0.0.6 — 2012-10-11
- 0.0.5 — 2012-10-01
- 0.0.4 — 2012-08-18
- 0.0.3 — 2012-07-15
- 0.0.2 — 2012-07-12
- 0.0.0 — 2012-07-11

## README

# PauseStream

This is a `Stream` that will strictly buffer when paused.
Connect it to anything you need buffered.

``` js
  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](https://github.com/dominictarr/stream-spec)
and [stream-tester](https://github.com/dominictarr/stream-tester)

This is now the default case of 
[through](https://github.com/dominictarr/through)

https://github.com/dominictarr/pause-stream/commit/4a6fe3dc2c11091b1efbfde912e0473719ed9cc0

---
_Source: https://npm.io/package/pause-stream · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
