# rl-store

> A cache story limited size

Latest version **0.1.1** (published 2019-03-05) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install rl-store
pnpm add rl-store
yarn add rl-store
bun add rl-store
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2019-03-05 |
| First published | 2019-02-11 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | pea3nut |
| Maintainers | pea3nut |

## Links

- npm: https://www.npmjs.com/package/rl-store
- npm.io page: https://npm.io/package/rl-store

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) ^10.12.24

## Recent versions

- 0.1.1 (latest) — 2019-03-05
- 0.1.0 — 2019-03-05
- 0.0.1 — 2019-02-11

## README

# rl-store

A map which be limited size of storage for catching.

Rin&Len store.


```ts
const RlStroe = require('rl-store');

const store = new RlStroe(1000); // Limite the store only retain 1000 length of string.

// to test the key exist
'key0' in store.data
// or
store.has('key0')

// to set
store.data['key1'] = 'value1';
store.dispatch('set', {key: 'key1'});
// or
store.set('key1', 'value1')

// to get
let value1 = store.data['key2'];
store.dispatch('get', {key: 'key2'});
// or
store.get('key2')

// to remove a key maunally
store.delete('key1');
```

And, you can extend RLStore to get the event when store be called into `get()`, `set()` and `delete()`.

```ts
const RlStroe = require('rl-store');

class MyRlStroe extends RlStroe {
    onGet(payload :any){
        console.log('got!');
        super.onGet(payload);
    }
}
```

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