# multi-memoize

> Multi-Level cache version Memoize

Latest version **1.0.10** (published 2020-10-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install multi-memoize
pnpm add multi-memoize
yarn add multi-memoize
bun add multi-memoize
```

## 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 | 1.0.10 |
| Published | 2020-10-05 |
| First published | 2020-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | sachaos |
| Maintainers | sachaos |

## Links

- npm: https://www.npmjs.com/package/multi-memoize
- npm.io page: https://npm.io/package/multi-memoize

## Dependencies (4)

- [memcached](https://npm.io/package/memcached.md) ^2.2.2
- [typescript](https://npm.io/package/typescript.md) ^3.9.6
- [async-rwlock](https://npm.io/package/async-rwlock.md) ^1.1.1
- [@types/memcached](https://npm.io/package/@types/memcached.md) ^2.2.6

## Recent versions

- 1.0.10 (latest) — 2020-10-05
- 1.0.9 — 2020-07-18
- 1.0.7 — 2020-07-18
- 1.0.6 — 2020-07-12
- 1.0.4 — 2020-07-12
- 1.0.3 — 2020-07-12
- 1.0.2 — 2020-07-12
- 1.0.1 — 2020-07-12
- 1.0.0 — 2020-07-12

## README

Multiple Level Memoize
---

## Install

```
npm i --save multi-memoize
```

## Usage

```typescript
import mmemoize, {Chain, AsyncMap, MemcachedMap} from 'multi-memoize'

// To use memcached backend
import Memcached from 'memcached-client'

// Use local cache as backend of memoize
const fetchData = mmemoize(async function() {
    // Time-consuming process e.g. fetch data from DB.
})

// Use local cache & memcached as backend of memoize
// Access local cache first. If missing on the local cache, access to memcached.
const fetchData = mmemoize(async function() {
    // Time-consuming process e.g. fetch data from DB.
}, new Chain([
    new AsyncMap(), 
    new MemcachedMap(new Memcached('127.0.0.1', 11211)),
]))
```

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