0.2.1 • Published 8 years ago

any-storage v0.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

any-storage Build Status

Use any possible storage mechanism available asynchronously.

Supports local storage, chrome storage, or in-memory storage.

Installation

npm install --save any-storage

Usage

var storage = require('any-storage');

// set
storage.set('someKey', 'value', function (err) {
});
storage.set({
  'anotherKey': 'indeed'
}, function (err) {
});

// get
storage.get('someKey', function (err, value) {
});
storage.get(['someKey', 'anotherKey'], function (err, value) {
  // value => {someKey: data, anotherKey: otherData }
});

// remove
storage.remove('someKey', function (err) {});
storage.remove(['someKey', 'anotherKey'], function (err) {
});

Contributing

Could definite use some test cases, mostly relies on just-storage

License

MIT