@onesy/cache
Version:
84 lines (58 loc) • 1.28 kB
Markdown
</br>
</br>
<p align='center'>
<a target='_blank' rel='noopener noreferrer' href='#'>
<img src='utils/images/logo.svg' alt='onesy logo' />
</a>
</p>
<h1 align='center'>onesy Cache</h1>
<p align='center'>
Cache
</p>
<br />
<h3 align='center'>
<sub>MIT license </sub>
<sub>Production ready </sub>
<sub>UMD 4.2kb gzipped </sub>
<sub>100% test cov </sub>
<sub>Browser and Nodejs</sub>
</h3>
<p align='center'>
<sub>Very simple code </sub>
<sub>Modern code </sub>
<sub>Junior friendly </sub>
<sub>Typescript </sub>
<sub>Made with :yellow_heart:</sub>
</p>
<br />
## Getting started
### Add
```sh
yarn add @onesy/cache
```
### Use
```javascript
import OnesyCache from '@onesy/cache';
const args = [4, { a: 4, ab: 4 }];
// Args is made into a hash, which makes the key
// a very useful, when you wanna cache a value based
// on some complex amount of variables
OnesyCache.add(4, ...args);
OnesyCache.get(...args);
// Output
// 4
```
### Dev
Install
```sh
yarn
```
Test
```sh
yarn test
```
### Prod
Build
```sh
yarn build
```