Socket
Socket
Sign inDemoInstall

superstore-sync

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

superstore-sync

Local storage, without the bugs.


Version published
Weekly downloads
708
increased by20%
Maintainers
4
Weekly downloads
 
Created
Source

superstore-sync Build Status NPM version

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

install

NPM

npm install superstore-sync --save

bower

bower install superstore-sync --save

api

superstore-sync is an uninstantiable module. Its methods are:

local

#local.get(key)

#local.set(key, value)

#local.unset(key)

#local.clear(prefix)

session

#session.get(key)

#session.set(key, value)

#session.unset(key)

#session.clear(prefix)

#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

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

todo

  • JSDoc comments and automatically generating documentation.

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