xieyezi-storage
v1.0.4
Published
a package that encapsulates localStorage and sessionStorage
Downloads
5
Maintainers
Readme
webStorage
一个将localStorage和sesionStorage封装到一起的包.
- [x] localStorage
- [x] sessionStorage
安装
npm install xieyezi-storage
用法
import xieyeziStorage form 'xieyezi-storage';
localStorage设置storage:
storage.set(key,val);
sessionStorage设置storage:
storage.session.set(key, val);
localStorage获取storage:
storage.get(key,val) ;
sessionStorage获取storage:
storage.session.get(key, val);
API
set(key,value):
get(key,def);
remove(key);
has(key);
clear();
getAll();
forEach(callback);