# stream-tap

> control (pause or resume) a node stream pipeline

Latest version **0.1.0** (published 2015-05-22) · MIT license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2015-05-22 |
| First published | 2015-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | zoubin |
| Maintainers | zoubin |
| Keywords | stream, pipeline, tap |

## Links

- npm: https://www.npmjs.com/package/stream-tap
- Repository: https://github.com/zoubin/stream-tap
- Homepage: https://github.com/zoubin/stream-tap#readme
- Issues: https://github.com/zoubin/stream-tap/issues
- npm.io page: https://npm.io/package/stream-tap

## Dependencies (1)

- [readable-stream](https://npm.io/package/readable-stream.md) ^1.0.33

## 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.1.0 (latest) — 2015-05-22

## README

# stream-tap
To control (pause or resume) a node stream pipeline. It returns a transform which is supposed to be included into a stream pipeline.

## Usage

```javascript
var Tap = require('stream-tap');
var tap = Tap();
```

### tap = Tap()
Return the tap transform.

### tap.turnOn()
`tap` will push no data, until `tap.turnOn()` is called.

### tap.turnOff()
Make `tap` collect data, and wait for `tap.turnOn` to flush.

## Example

```javascript
var Tap = require('..');
var thr = require('through2');

var s1 = thr();
var s2 = thr();
var tap = Tap();

s1.pipe(tap).pipe(s2).pipe(process.stdout);

console.log('Writing into the pipeline');
[1,2,3,4,5].map(String).forEach(s1.write, s1);
s1.end();
console.log('Writing end');
console.log('turn tap on');
tap.turnOn();
```

output:

```
⌘ node example/tap.js
Writing into the pipeline
Writing end
turn tap on
12345
```

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