Local storage, without the bugs.
npm install superstore-syncSuperstore is a simple lightweight synchronous wrapper around the Web Storage APIs localStorage and sessionStorage. Its features include:
- It is resilient to iOS's strange behaviour in private browsing mode.
- It accepts objects as values and runs JSON.stringify on #set and JSON.parse on #get for you.
If you require an asyncronous version please use superstore instead.
npm install superstore-sync --save
`$3
`
bower install superstore-sync --save
`api
superstore-sync is an uninstantiable module. Its methods are:
local
$3
$3
$3
$3
session
$3
$3
$3
$3
#isPersisting()
* returns a boolean set to true if data is being persisted to storage, or false if it is being kept in memory (e.g. if localStorage is full or inaccessible).usage
`javascript
var store = require('superstore-sync');//Persist a value to local storage
var value = store.local.set('foo', 'bar');
//Get a value from session storage
var session = store.session.get('baz');
``- JSDoc comments and automatically generating documentation.