bstore

1.0.4 • Public • Published

bstore

a simple localstorage with memory fallback for browser.

Build Status GitHub license

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.

Package Sidebar

Install

npm i bstore

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

503 kB

Total Files

13

Last publish

Collaborators

  • gnipbao