Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yeliex/easycache
a lightweight cache library
https://github.com/yeliex/easycache
Last synced: about 2 months ago
JSON representation
a lightweight cache library
- Host: GitHub
- URL: https://github.com/yeliex/easycache
- Owner: yeliex
- License: mit
- Created: 2016-09-21T05:29:51.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-22T05:39:31.000Z (over 6 years ago)
- Last Synced: 2024-11-04T04:19:17.087Z (about 2 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# easyCache (with the uppercase `C`)
a lightweight cache library## Installation
```
$ npm install easyCache --save
```## Usage
```js
import { read, write } from 'easyCache';
write('key', 'value'); // value
read('key'); // value
```## Api
- `read(keys: string/array)`
- get value from cache with key(s)
- `keys` can be a string with `.` or an array
- if `keys` is `undefined`, return the whole cache (not recommend)
- nested support
- `write(keys: string/array, value: any)`
- write value to cache with key(s)
- `keys` can be a string with `.` or an array
- but cannot be `undefined`
- nested support
- `set`
- alias of `write`
- `clear(key: string)`
- remove the **first class** value with key
- if `keys` is `undefined`, remove `everything`
- do not support nested cahce remove(welcome pr)
## About PR
we really need another name as you see, so welcome for advices