# async-cache-promise

> async-cache - but with promises

Latest version **2.0.2** (published 2016-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install async-cache-promise
pnpm add async-cache-promise
yarn add async-cache-promise
bun add async-cache-promise
```

## 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.0.2 |
| Published | 2016-07-05 |
| First published | 2016-06-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | David Björklund |
| Maintainers | kesla |
| Keywords | asyc-cache, promise |

## Links

- npm: https://www.npmjs.com/package/async-cache-promise
- Repository: https://github.com/kesla/async-cache-promise
- Homepage: https://github.com/kesla/async-cache-promise#readme
- Issues: https://github.com/kesla/async-cache-promise/issues
- npm.io page: https://npm.io/package/async-cache-promise

## Dependencies (3)

- [bluebird](https://npm.io/package/bluebird.md) ^3.4.0
- [async-cache](https://npm.io/package/async-cache.md) ^1.1.0
- [immutable-object-methods](https://npm.io/package/immutable-object-methods.md) ^1.1.2

## 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.0.2 (latest) — 2016-07-05
- 2.0.1 — 2016-06-18
- 2.0.0 — 2016-06-11
- 1.0.0 — 2016-06-07

## README

# async-cache-promise [![Build Status](https://travis-ci.org/kesla/async-cache-promise.png?branch=master)](https://travis-ci.org/kesla/async-cache-promise)

async-cache - but with promises

## Installation

Download node at [nodejs.org](http://nodejs.org) and install it, if you haven't already.

```sh
npm install async-cache-promise --save
```

## Usage

```js
import co from 'co';
import setupAsyncCache from 'async-cache-promise';

co(function * (t) {
  let count = 0;
  const cache = setupAsyncCache({
    load: key => {
      count++;
      return Promise.resolve(key);
    }
  });

  console.log('this is not cached', yield cache.get(123));
  console.log('this is cached', yield cache.get(123));
});

```

## Tests

```sh
npm install
npm test
```

## Dependencies

- [async-cache](https://github.com/isaacs/async-cache): Cache your async lookups and don&#39;t fetch the same thing more than necessary.
- [bluebird](https://github.com/petkaantonov/bluebird): Full featured Promises/A+ implementation with exceptionally good performance
- [immutable-object-methods](https://github.com/micnews/immutable-object-methods): Update normal plain javascript object, immutable style. Simlar to how immutable.js, seamless-immutable etc does it but a lot smaller and simpler.

## Dev Dependencies

- [babel-cli](https://github.com/babel/babel/tree/master/packages): Babel command line.
- [babel-core](https://github.com/babel/babel/tree/master/packages): Babel compiler core.
- [babel-preset-es2015](https://github.com/babel/babel/tree/master/packages): Babel preset for all es2015 plugins.
- [babel-tape-runner](https://github.com/wavded/babel-tape-runner): Babel + Tape for running your ES Next tests
- [semistandard](https://github.com/Flet/semistandard): All the goodness of `feross/standard` with semicolons sprinkled on top.
- [snazzy](https://github.com/feross/snazzy): Format JavaScript Standard Style as Stylish (i.e. snazzy) output
- [tapava](https://github.com/kesla/tapava): the syntax of ava, run through tape


## License

MIT

_Generated by [package-json-to-readme](https://github.com/zeke/package-json-to-readme)_

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