Socket
Socket
Sign inDemoInstall

superstore

Package Overview
Dependencies
Maintainers
4
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

superstore

Local storage, without the bugs, and an asynchronous API


Version published
Weekly downloads
0
Maintainers
4
Weekly downloads
 
Created
Source

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.

  • 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.

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

Keywords

FAQs

Package last updated on 10 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc