Simple wrapper for localStorage. Makes dealing with localStorage
less tedious. Calls JSON.parse
and JSON.stringify
for you and uses debug
under the hood to create a smooth debugging experience.
npm install simple-local
var local = require('simple-local');
local.set('myKey', {foo: 'bar', bin: 'baz'});
local.get('myKey')
// => {foo: 'bar', bin: 'baz'}
To enable debugging set in the browser console:
localStorage.debug = 'simple-local';
Set the store to contain a value at key.
store.set('key', 12348899);
store.set('config', ['foo', 'bar']);
Get a value from the store. Emits a get
event which can
be namespaced to allow for specific listeners.
store.get('config');
// => ['foo', 'bar']