Socket
Book a DemoInstallSign in
Socket

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.

2.1.1
latest
Source
npmnpm
Version published
Weekly downloads
1.5K
46.39%
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

localstorage

FAQs

Package last updated on 07 Nov 2018

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.