node-mithril-storage
v0.0.4
Published
Node implementation of mithril-storage. Based on https://github.com/kawan16/mithril-storage
Downloads
8
Maintainers
Readme
node-mithril-storage
Node implementation of mithril-storage.
How to install
You can install this package using npm.
npm install node-mithril-storage
How to use it
var mx = require('node-mithril-storage');
var storage = mx.storage();
// same as
// var storage = mx.storage(mx.DEFAULT_STORAGE_NAME, mx.DEFAULT_STORAGE);
// Add the object to storage
storage.set('test', {message: 'TEST'});
// Get the object from storage.
var test = storage.get('test');
// Remove the key from storage
storage.remove('test');
Available storage types
mx.LOCAL_STORAGE // [DEFAULT_STORAGE]
mx.IN_MEMORY_STORAGE