# pull-pair

> pair a source pull-stream and a sink pull-stream

Latest version **1.1.0** (published 2016-03-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install pull-pair
pnpm add pull-pair
yarn add pull-pair
bun add pull-pair
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2016-03-13 |
| First published | 2013-12-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dominic Tarr |
| Maintainers | dominictarr |

## Links

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

## Recent versions

- 1.1.0 (latest) — 2016-03-13
- 1.0.0 — 2013-12-08

## README

# pull-pair

A pair of {source, sink} streams that are internally connected,
(what goes into the sink comes out the source)

This can be used to construct pipelines that are connected.

``` js
var pull = require('pull-stream')
var pair = require('pull-pair')

var p = pair()

//read values into this sink...
pull(pull.values([1, 2, 3]), p.sink)

//but that should become the source over here.
pull(p.source, pull.collect(function (err, values) {
  if(err) throw err
  console.log(values) //[1, 2, 3]
}))

```

This is particularily useful for creating duplex streams especilaly
around servers. Use `pull-pair/duplex` to get two duplex streams
that are attached to each other.

``` js
var DuplexPair = require('pull-pair/duplex')

var d = DuplexPair()

//the "client": pipe to the first duplex and get the response.
pull(
  pull.values([1,2,3]),
  d[0],
  pull.collect(console.log) // => 10, 20, 30
)

//the "server": pipe from the second stream back to itself
//(in this case) appling a transformation.
pull(
  d[1],
  pull.map(function (e) {
    return e*10
  }),
  d[1]
)
```

## License

MIT

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