# immediate-chunk-store

> Immediate put/get for abstract-chunk-store compliant stores

Latest version **2.2.0** (published 2021-05-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install immediate-chunk-store
pnpm add immediate-chunk-store
yarn add immediate-chunk-store
bun add immediate-chunk-store
```

## 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 | 2.2.0 |
| Published | 2021-05-19 |
| First published | 2015-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 20 |
| Author | Feross Aboukhadijeh |
| Maintainers | mafintosh, feross |
| Keywords | abstract-chunk-store, chunk, in-memory, immediate, sync, cache, store |

## Links

- npm: https://www.npmjs.com/package/immediate-chunk-store
- Repository: https://github.com/feross/immediate-chunk-store
- Issues: https://github.com/feross/immediate-chunk-store/issues
- Funding: https://github.com/sponsors/feross
- npm.io page: https://npm.io/package/immediate-chunk-store

## Dependencies (1)

- [queue-microtask](https://npm.io/package/queue-microtask.md) ^1.2.3

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 2.2.0 (latest) — 2021-05-19
- 2.1.1 — 2020-10-27
- 2.1.0 — 2019-09-12
- 2.0.0 — 2018-08-04
- 1.0.8 — 2016-02-12
- 1.0.7 — 2015-08-20
- 1.0.6 — 2015-08-20
- 1.0.5 — 2015-08-15
- 1.0.4 — 2015-08-15
- 1.0.3 — 2015-08-15
- 1.0.2 — 2015-08-15
- 1.0.1 — 2015-08-15
- 1.0.0 — 2015-08-15

## README

# immediate-chunk-store [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

[ci-image]: https://img.shields.io/github/workflow/status/feross/immediate-chunk-store/ci/master
[ci-url]: https://github.com/feross/immediate-chunk-store/actions
[npm-image]: https://img.shields.io/npm/v/immediate-chunk-store.svg
[npm-url]: https://npmjs.org/package/immediate-chunk-store
[downloads-image]: https://img.shields.io/npm/dm/immediate-chunk-store.svg
[downloads-url]: https://npmjs.org/package/immediate-chunk-store
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com

#### Immediate put/get for [abstract-chunk-store](https://github.com/mafintosh/abstract-chunk-store) compliant stores

[![abstract chunk store](https://cdn.rawgit.com/mafintosh/abstract-chunk-store/master/badge.svg)](https://github.com/mafintosh/abstract-chunk-store)

Makes `store.put()` chunks immediately available for `store.get()`, even before the
`store.put()` callback is called. Data is stored in memory until the `store.put()`
is complete.

## Install

```
npm install immediate-chunk-store
```

## Usage

``` js
var ImmediateChunkStore = require('immediate-chunk-store')
var FSChunkStore = require('fs-chunk-store') // any chunk store will work

var store = new ImmediateChunkStore(new FSChunkStore(10))

store.put(0, Buffer.from('abc'), function () { /* yolo */ })

// And now, get the same chunk out BEFORE the put is complete
store.get(0, function (err, data) {
  if (err) throw err
  console.log(data.toString()) // 'abc'
})
```

## License

MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).

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