# kitten-cache

> Highly performant LRU cache.

Latest version **0.3.0** (published 2020-01-13) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install kitten-cache
pnpm add kitten-cache
yarn add kitten-cache
bun add kitten-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.3.0 |
| Published | 2020-01-13 |
| First published | 2019-03-13 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ideolys |
| Maintainers | dgrelaud, mrobin |

## Links

- npm: https://www.npmjs.com/package/kitten-cache
- npm.io page: https://npm.io/package/kitten-cache

## Recent versions

- 0.3.0 (latest) — 2020-01-13
- 0.2.0 — 2019-03-13

## README

# Kitten-cache

Highly performant LRU cache.

## Install

1. Install
```bash
  npm i kitten-cache
```
2. Require the dependence
```js
  const Cache = require('kitten-cache');
```
3. Declare new instance
```js
  let cache = new Cache();
```

## API

### Instance

```js
  new Cache(options)

  /*
    options : {
      size     : default 50,
      onRemove : function to call when a key/value is removed from the cache
    }
  */
```

### Cache.set(key, value)

```js
  let cache = new Cache();

  cache.set('a', 1);
```

### Cache.get(key)

```js
  let cache = new Cache();

  cache.set('a', 1);
  cache.get('a'); // -> 1
```

### Cache.has(key)

```js
  let cache = new Cache();

  cache.set('a', 1);
  cache.has('a'); // -> true
  cache.has('b'); // -> false
```

### Cache.delete(key)

```js
  let cache = new Cache();

  cache.set('a', 1);

  cache.delete('a'); // -> true
  cache.delete('b'); // -> false
```

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