a storage lib which support sessionStorage and localStorage with the same api
Switch branches/tags
Nothing to show
Clone or download
Latest commit edcb8d1 Nov 5, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build use rollup Nov 5, 2018
demo finish Apr 9, 2017
dist build Nov 5, 2018
src update to v1.1.0 Nov 5, 2018
.babelrc use rollup Nov 5, 2018
.editorconfig finish Apr 9, 2017
.eslintignore finish Apr 9, 2017
.eslintrc.js finish Apr 9, 2017
.gitignore finish Apr 9, 2017
LICENSE Initial commit Apr 9, 2017
README.md Update README.md May 20, 2017
package-lock.json use rollup Nov 5, 2018
package.json update to v1.1.0 Nov 5, 2018
webpack.dev.js finish Apr 9, 2017
webpack.prod.js finish Apr 9, 2017

README.md

storage

a storage lib which support sessionStorage and localStorage with the same api

Install

 npm install good-storage

Usage

 import storage from 'good-storage'
 
 // localStorage
 storage.set(key,val) 
 
 storage.get(key, def)
 
 // sessionStorage
 storage.session.set(key, val)
 
 storage.session.get(key, val)
 

API

set(key, val)

set storage with key and val

get(key, def)

get storage with key, return def if not find

remove(key)

remove storage with key

has(key)

determine storage has the key

clear()

clear all storages

getAll()

get all the storages

forEach(callback)

forEach the storages and call the callback function with each storage