2.1.0 • Published 10 years ago
superstore v2.1.0
superstore 
Superstore is a simple lightweight asynchronous wrapper around the Web Storage APIs localStorage and sessionStorage. Its features include:
If you require an synchronous version please use superstore-sync instead.
- It is resilient to iOS's strange behaviour in private browsing mode.
- It accepts objects as values and runs
JSON.stringifyon #set andJSON.parseon #get for you.
Installation
npm
npm install superstore --savebower
bower superstore --saveapi
Superstore is an instantiable module. All Superstore methods return a Promise which will resolve with the stored value. Its methods are:
constructor (type, namespace)
var localStore = new Superstore('local', 'foo');
var sessionStore = new Superstore('session', 'bar');#get(key)
#set(key, value)
#unset(key)
#clear()
Superstore.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).
Example usage
var Superstore = require('superstore');
var store = new Superstore('local', 'foo');
store.get('bar').then(function(value){
// Do something with value
});2.1.0
10 years ago
2.0.1
10 years ago
2.0.0
10 years ago
1.0.0
11 years ago
0.5.3
11 years ago
0.5.2
11 years ago
0.5.1
12 years ago
0.5.0
12 years ago
0.4.4
12 years ago
0.4.3
12 years ago
0.4.2
12 years ago
0.4.1
12 years ago
0.4.0
12 years ago
0.3.3
12 years ago
0.3.2
12 years ago
0.3.1
12 years ago
0.3.0
12 years ago
0.2.1
12 years ago
0.2.0
12 years ago