# pull-cache

> cache a pull-stream

Latest version **0.0.0** (published 2016-03-07) · Fair license · 0 weekly downloads

## Install

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

## 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.0 |
| Published | 2016-03-07 |
| First published | 2016-03-07 |
| Weekly downloads | 0 |
| License | Fair |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Charles Lehner |
| Maintainers | cel |
| Keywords | pull-stream |

## Links

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

## 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.0.0 (latest) — 2016-03-07

## README

# pull-cache

Cache a pull-stream source so that you can read it multiple times and the
underlying source only gets read once. Backpressure is respected, so if none of
the resulting cached sources are read, the underlying source is not read.

```js
var cache = require('pull-cache')

var sourceCache = pull(expensiveSource, cache)
pull(sourceCache(), ...)
pull(sourceCache(), ...)
pull(sourceCache(), ...)
```

## API

#### `cache(source): sourceCache`

Transform a readable stream `source` into a `sourceCache` function

#### `sourceCache(): cachedSource`

Return a new readable stream `cachedSource` that streams the same data as would
be read from `source`

#### `sourceCache(end, cb)`

Abort the underlying source and end its cached sources

## License

Copyright (c) 2016 Charles Lehner

Usage of the works is permitted provided that this instrument is
retained with the works, so that any entity that uses the works is
notified of this instrument.

DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.

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