0.1.4 • Published 8 years ago

unified-storage v0.1.4

Weekly downloads
21
License
OML
Repository
-
Last release
8 years ago

Unified Storage

There are many polyfill libs for web storage. None of them make storage any easier to work with. Unified Storage does just that by providing single object that you can use to access items from localStorage, sessionStorage, or any other storage that you create.

Example

var uStorage = require('unified-storage');

//Pass in the object model you want to use
var myStorage = uStorage({
  something: {
    value: localStorage,
    prop: localStorage
  },
  somethingElse: {
    value: sessionStorage,
    prop: sessionStorage
  }
});

//You can now access your values off of the newly created object
var myValue = myStorage.something.value;

//and can be set the same way
myStorage.something.value = myValue

Extension

Any object that is inherited from Storage can be used. Just pass it instead of localStorage or sessionStorage. Do it, extend it with a polyfill. I dare you.

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago