wxapp-storage
Git Package Manager, make you manage the repository easier
Installation
npm install @axetroy/wxapp-storage
Features
- 存储绝大多数的数据类型(微信原生对象只支持object/string)
- 设置有存储时限
- 优雅的API
Usage
// usage
import Storage from '@axetroy/wxapp-storage';
const store = new Storage(wx);
store.set('userinfo',{
username: 'axetroy',
age: 'Forever Young'
});
console.log(store.get('userinfo'));
API
store.set(key:string, value:any, expiration:number):this
存储
store.get(key:string):any
store.remove(key:string):this
store.clear():this
Contributing
git clone https://github.com/axetroy/wxapp-storage.git
cd ./wxapp-storage
yarn
You can flow Contribute Guide
Contributors
Axetroy |
---|
License
The MIT License