2.1.0 • Published 8 years ago

superstore v2.1.0

Weekly downloads
140
License
MIT
Repository
github
Last release
8 years ago

superstore Build Status

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.

Installation

npm

npm install superstore --save

bower

bower superstore --save

api

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

8 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.0

9 years ago

0.5.3

9 years ago

0.5.2

10 years ago

0.5.1

11 years ago

0.5.0

11 years ago

0.4.4

11 years ago

0.4.3

11 years ago

0.4.2

11 years ago

0.4.1

11 years ago

0.4.0

11 years ago

0.3.3

11 years ago

0.3.2

11 years ago

0.3.1

11 years ago

0.3.0

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago