Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including superstore with all npm packages installed. Try it out:

var superstore = require("superstore")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

superstore v2.1.0

Local storage, without the bugs, and an asynchronous API

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
});

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free