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
24 lines (19 loc) • 547 B
JavaScript
function MemoryStore() {
this.clear();
}
MemoryStore.prototype.clear = function(callback) {
this.store = {};
if (callback) return callback();
};
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) return callback();
};
MemoryStore.prototype.delete = function(key, callback) {
delete this.store[key];
if (callback) return callback();
};
module.exports = MemoryStore;