UNPKG

nitrogen

Version:

Nitrogen is a platform for building connected devices. Nitrogen provides the authentication, authorization, and real time message passing framework so that you can focus on your device and application. All with a consistent development platform that lev

22 lines (17 loc) 466 B
function MemoryStore() { this.clear(); } MemoryStore.prototype.clear = function(callback) { this.store = {}; }; MemoryStore.prototype.get = function(key, callback) { return callback(null, this.store[key]); }; MemoryStore.prototype.set = function(key, value, callback) { this.store[key] = value; if (callback) callback(); }; MemoryStore.prototype.delete = function(key, callback) { delete this.store[key]; }; module.exports = MemoryStore;