# pull-redirectable

> Redirectable pull-streams

Latest version **0.1.2** (published 2017-12-03) · MIT license · 0 weekly downloads

## Install

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

## 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.2 |
| Published | 2017-12-03 |
| First published | 2017-11-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Maciej Krüger |
| Maintainers | mkg20001 |
| Keywords | pull-stream, redirectable, duplex, source, sink |

## Links

- npm: https://www.npmjs.com/package/pull-redirectable
- Repository: https://github.com/mkg20001/pull-redirectable
- Homepage: https://github.com/mkg20001/pull-redirectable#readme
- Issues: https://github.com/mkg20001/pull-redirectable/issues
- npm.io page: https://npm.io/package/pull-redirectable

## Dependencies (2)

- [pull-stream](https://npm.io/package/pull-stream.md) ^3.6.1
- [pull-pushable](https://npm.io/package/pull-pushable.md) ^2.1.1

## 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.2 (latest) — 2017-12-03
- 0.1.1 — 2017-12-03
- 0.1.0 — 2017-12-03
- 0.0.2 — 2017-11-30
- 0.0.1 — 2017-11-30

## README

# pull-redirectable

Redirectable pull-streams

# API

 - `.source()`: Creates a redirectable source
 - `.sink()`: Creates a redirectable sink
 - `.duplex()`: Creates a redirectable duplex

## Stream API

`.changeDest(to)`: Changes the destination to `a` or `b`

Every stream exposes an `a` and `b` stream.

The main stream is an inverse of the type (e.g sink => source)

# Example

```js
it('moves half the data from a to o and the other half from b', cb => {
  const s = redir.sink()
  let i = 0

  pull(
    pull.values(v.slice(0, 2)),
    pull.map(v => {
      i++
      if (i === 2) s.changeDest('b')
      return v
    }),
    s.a.sink
  )

  pull(
    pull.values(v.slice(2)),
    s.b.sink
  )

  pull(
    s.source,
    pullCompare(v, cb)
  )
})
```

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