bstore
v1.0.4
Published
Simple localStorage with memory fallback use es6
Downloads
12
Readme
bstore
a simple localstorage with memory fallback for browser.
Install
$ npm install --save bstore
Usage
// import
import ls from bstore;
ls.set('key','value');
ls.get('key'); // value
ls.remove('key');
// require
const ls = require('bstore')
ls.set('key','value');
ls.get('key'); // value
ls.remove('key');
API
set(key, value)
set storage with key and value
get(key)
get storage with key, return undefined if not find.
remove(key)
remove storage with key.
key(index)
get key by index.
has(key)
if has key return true else false.
clear()
clear all storage
forEach(cb)
forEach the storages and call the cb function with each storage
getAll()
get all the storages.