storagejs
v1.0.7
Published
Async API that uses either chrome.storage.local or localStorage depending on environment
Downloads
12
Maintainers
Readme
storagejs
A wrapper for localStorage, which will use chrome.storage if used in a chrome packaged app.
Installation
$ npm install storagejs
Description
This is a wrapper for localStorage, which will use chrome.storage.local if it is used in a chrome packaged app.
If using NPM:
var storagejs = require('storagejs');
To set an item just use:
options = {
success: function() {},
error: function(errorMessage) {}
};
storagejs.put('myKey', {my: 'Object'}, options);
// or
storagejs.put('myKey', 'myString', options);
To get:
options = {
success: function(value) {},
error: function(errorMessage) {}
};
storagejs.get('myKey', options);
Author
Thomas Delaet [email protected]