# tuple-stream

> zip together two streams into a single stream with aligned pairwise data

Latest version **0.0.2** (published 2013-06-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install tuple-stream
pnpm add tuple-stream
yarn add tuple-stream
bun add tuple-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.2 |
| Published | 2013-06-12 |
| First published | 2013-06-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | James Halliday |
| Maintainers | substack |
| Keywords | pair, pairwise, zip, stream |

## Links

- npm: https://www.npmjs.com/package/tuple-stream
- Repository: https://github.com/substack/tuple-stream
- npm.io page: https://npm.io/package/tuple-stream

## Dependencies (1)

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

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 0.0.2 (latest) — 2013-06-12
- 0.0.1 — 2013-06-12
- 0.0.0 — 2013-06-12

## README

# tuple-stream

zip together two streams into a single stream with aligned pairwise data

[![browser support](https://ci.testling.com/substack/tuple-stream.png)](http://ci.testling.com/substack/tuple-stream)

[![build status](https://secure.travis-ci.org/substack/tuple-stream.png)](http://travis-ci.org/substack/tuple-stream)

# example

This is easy to understand with lines:

``` js
var split = require('split');
var through = require('through');
var tuple = require('../');

var a = split(), b = split();

tuple(a, b).pipe(through(function (pair) {
    this.queue(pair[0] + ' | ' + pair[1] + '\n');
})).pipe(process.stdout);

a.end('one\ntwo\nhree\n4\nfive');
b.end('one\ntwo\nthree\nfour\n');
```

output:

```
one | one
two | two
hree | three
4 | four
five | 
```

Here the `split` module chunks up its input by newlines, sending a separate
chunk for each line. The `tuple` module kicks in and aligns the events by order
such that the first event from `a` is paired with the first event from `b` and
so on.

# methods


``` js
var tuple = require('tuple-stream')
```

## tuple(a, b)

Return a readable stream that zips together the data from readable streams `a`
and `b` into an array data chunk with `[achunk,bchunk]`.

When a stream is finished but its partner isn't, it will emit `null` data.

# install

With [npm](https://npmjs.org) do:

```
npm install tuple-stream
```

# license

MIT

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