# memcached-typed

> Typescript cached fetching helper

Latest version **7.0.0** (published 2020-01-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install memcached-typed
pnpm add memcached-typed
yarn add memcached-typed
bun add memcached-typed
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 7.0.0 |
| Published | 2020-01-30 |
| First published | 2017-08-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 29 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Kurt Lee |
| Maintainers | kurtlee, mooyoul, sejung.kwon |

## Links

- npm: https://www.npmjs.com/package/memcached-typed
- Repository: https://github.com/balmbees/memcached-typed
- Homepage: https://github.com/balmbees/memcached-typed#readme
- Issues: https://github.com/balmbees/memcached-typed/issues
- npm.io page: https://npm.io/package/memcached-typed

## Dependencies (2)

- [ioredis](https://npm.io/package/ioredis.md) ^4.11.2
- [@types/ioredis](https://npm.io/package/@types/ioredis.md) ^4.0.13

## Recent versions

- 7.0.0 (latest) — 2020-01-30
- 5.0.1-beta.0 (canary) — 2019-06-30
- 6.0.1 — 2019-07-17
- 5.0.0 — 2019-06-21
- 4.2.4 — 2018-11-02
- 4.2.3 — 2018-11-02
- 4.2.2 — 2018-11-01
- 4.2.1 — 2018-11-01
- 4.2.0 — 2018-11-01
- 4.2.0-beta.4 — 2018-10-31
- 4.2.0-beta.3 — 2018-10-31
- 4.2.0-beta.2 — 2018-10-31
- 4.2.0-beta.1 — 2018-10-31
- 4.2.0-beta.0 — 2018-10-31
- 4.1.5 — 2018-09-15
- … 26 more at https://npm.io/package/memcached-typed/versions

## README

# Memcached-Typed

[![Build Status](https://travis-ci.com/balmbees/memcached-typed.svg?branch=master)](https://travis-ci.com/balmbees/memcached-typed)

npm install memcached-typed --save

1. Support Promise for every method
2. Support <T> for get / set methods
3. Advanced cache-access pattern such as fetch.

```typescript
describe("#fetchMulti", () => {
  const memcached = new Memcached();
  const fetcher = new MemcachedFetcher(memcached);

  it("should fetch only missing sets", async () => {
    const res1 = await fetcher.multiFetch(
      [1, 2, 3, 4, 5],
      (arg) => `v1-${arg}`,
      3600,
      async (args) => {
        return args.map((arg) => arg * arg);
      }
    );
    expect(res1).to.deep.eq([1, 4, 9, 16, 25]);

    // it's using same hash key, so should reuse cache for exsiting values
    const res2 = await fetcher.multiFetch(
      [1, 2, 100, 200, 5],
      (arg) => `v1-${arg}`,
      3600,
      async (args) => {
        return args.map((arg) => arg + arg);
      }
    );
    expect(res2).to.deep.eq([1, 4, 200, 400, 25]);

    const res3 = await fetcher.multiFetch(
      [],
      (arg) => `v1-${arg}`,
      3600,
      async (args) => {
        return args.map((arg) => arg);
      }
    );
    expect(res3).to.deep.eq([]);
  });
});
```

# AWS Elasticache autoDiscovery

this only supports > 1.4.14

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