superstore-sync

2.1.1 • Public • Published

superstore-sync Build Status NPM version

Superstore is a simple lightweight synchronous wrapper around the Web Storage APIs localStorage and sessionStorage. Its features include:

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.

Package Sidebar

Install

npm i superstore-sync

Weekly Downloads

1,375

Version

2.1.1

License

MIT

Unpacked Size

8.86 kB

Total Files

7

Last publish

Collaborators

  • financial-times
  • ftlabs
  • kornel
  • mattandrews