# push-to-pull

> Convert a push-filter to a pull-filter (for simple streams)

Latest version **0.1.0** (published 2013-07-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install push-to-pull
pnpm add push-to-pull
yarn add push-to-pull
bun add push-to-pull
```

## 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 | 2013-07-06 |
| First published | 2013-07-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Tim Caswell |
| Maintainers | creationix |
| Keywords | simple-stream, push-filter, stream |

## Links

- npm: https://www.npmjs.com/package/push-to-pull
- Repository: https://github.com/creationix/push-to-pull
- Issues: https://github.com/creationix/push-to-pull/issues
- npm.io page: https://npm.io/package/push-to-pull

## 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) — 2013-07-06
- 0.0.3 — 2013-07-05
- 0.0.2 — 2013-07-03
- 0.0.1 — 2013-07-03

## README

push-to-pull
============

Convert a push-filter to a pull-filter (for simple streams)

Usage is simple.  Define your filter as an `(emit) -> emit` transform where `emit` is `(err, item)`.  Then when you need an `(stream) -> stream` filter, use this module to convert it.

```js
var pushToPull = require('push-to-pull');

// Dumb filter that inputs numbers and outputs that many monkeys
// Encoded as an (emit) -> emit transform filter.
function pushFilter(emit) {
  return function (item) {
    if (item === undefined) return emit();
    for (var i = 1; i <= item; i++) {
      emit("MONKEY " + i);
    }  
  }
}

// Same filter, but as a (stream) -> stream transform filter
var pullFilter = pushToPull(pushFilter);
```

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