simple-lscache
v1.0.1
Published
localStorage数据增加缓存时间,到期删除缓存,支持 web, uni-app, 微信小程序
Downloads
3
Readme
local-storage-cache
npm:
npm install simple-lscache
yarn:
yarn add simple-lscache
usage:
import lscache from 'simple-lscache';
//set string 60s
lscache.set('key1', '11', 60);
//set object 60s
lscache.set('key2', {key: 'val'}, 60);
//get
lscache.get('key1');
//del
lscache.del('key1');
simple usage:
import {cache} from 'simple-lscache';
//set
cache('key1', 'val', 60);
cache('key2', {key: 'val'}, 60);
//get
cache('key1');