0.0.4 • Published 8 years ago

node-mithril-storage v0.0.4

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

Build Status npm version

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