cache data based on localstorage in browser, support expire time
npm install cachest
[npm-badge]: https://img.shields.io/npm/v/cachest.svg
[npm-url]: https://www.npmjs.com/package/cachest
[npm-downloads]: https://img.shields.io/npm/dm/cachest.svg
[travis-badge]: https://www.travis-ci.org/ZiQiangWang/cachest.svg?branch=master
[travis-url]: https://www.travis-ci.org/ZiQiangWang/cachest
[unpkg-url]: https://unpkg.com/cachest/dist/cachest.min.js
[coveralls-badge]: https://coveralls.io/repos/ZiQiangWang/cachest/badge.svg?branch=master
[coveralls-url]: https://coveralls.io/github/ZiQiangWang/cachest
Cache data based on localstorage in browser, expire property is provided.
```
npm i cachest
`Js`
import cachest from 'cachest';
or
`Js`
const cachest = require('cachest');
Assign value to key with expire time,if expire is not defined, keep the value until to be removed.
Params
* key {String}: The key of the property to save.value
* {any}: The content to save.expire
* {Number}: Expire time, ms as unit
Return the value of key.
Params
- key {String}: The key of the property to get.
- return {*}
Remove the value of key.
Params
- key {String}: The key of the property to remove.
Clear all saved value.
Get the keys not expired.
- return {Array}
return {Number}
Length of keys.
Check if the key is expired, return true if key is not existed.
Params
- key` {String}: The key of the property to check.
- return {Boolean}
Copyright © 2018, ZiQiangWang.
Released under the MIT License.