1.0.13 • Published 10 months ago
@jswork/next-store v1.0.13
next-store
Storage for weapp based on next.
installation
npm install -S @jswork/next-store
apis
api | params | default | description |
---|---|---|---|
$ | (name, purify) | - | Select local/session engine instance. |
config | (options) | - | Select local/session engine instance. |
usage
import NxStore from '@jswork/next-store';
// init with namespace(prefix)
const store = new NxStore({ prefix:'abc', purify: true });
// set
store.local = { name:'nx', github:'afeiship', items:['next','gem','nx']}
// get
const { name } = store.local;
// get/gets/set/sets/del/dels/clear
store.$('local').del('nx');
store.$('local', true).del('xxx');
store.config({ prefix:'myprefix'})
license
Code released under the MIT license.