Skip to content
Clean interface for localStorage / sessionStorage
Branch: master
Clone or download
Latest commit 00646fa Apr 13, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE MIT License instead of GNU Feb 17, 2017
README.md Typo Apr 13, 2017
bower.json add keywords Sep 1, 2015
extendStorage.js save a line Apr 13, 2017

README.md

simpleWebstorage

A clean interface for localStorage / sessionStorage in <20 lines of code.

Even simpler than simpleStorage the simpler fork of jStorage.

Installs with bower install simple-webstorage --save

Usage

localStorage.set('myKey',{a:[1,2,5], b: 'ok'}); //can set a json Object
localStorage.assign('myKey',{a:[6], c:42});     //shallow merge using Object.assign
localStorage.has('myKey');                      // --> true
localStorage.get('myKey');                      // --> {a:[6], b: 'ok', c:42}
localStorage.keys();                            // --> ['myKey']
localStorage.remove('myKey');                   // -

of course you can use native

localStorage.clear();
localStorage.length;

works as well with sessionStorage.

You can’t perform that action at this time.