UNPKG

keys

Version:

Unified api for node key/value stores

72 lines (71 loc) 3.58 kB
/* automatically generated by JSCoverage - do not edit */ if (typeof _$jscoverage === 'undefined') _$jscoverage = {}; if (! _$jscoverage['stores/nstore.js']) { _$jscoverage['stores/nstore.js'] = []; _$jscoverage['stores/nstore.js'][12] = 0; _$jscoverage['stores/nstore.js'][14] = 0; _$jscoverage['stores/nstore.js'][15] = 0; _$jscoverage['stores/nstore.js'][16] = 0; _$jscoverage['stores/nstore.js'][17] = 0; _$jscoverage['stores/nstore.js'][20] = 0; _$jscoverage['stores/nstore.js'][21] = 0; _$jscoverage['stores/nstore.js'][24] = 0; _$jscoverage['stores/nstore.js'][25] = 0; _$jscoverage['stores/nstore.js'][28] = 0; _$jscoverage['stores/nstore.js'][29] = 0; _$jscoverage['stores/nstore.js'][32] = 0; _$jscoverage['stores/nstore.js'][33] = 0; _$jscoverage['stores/nstore.js'][34] = 0; _$jscoverage['stores/nstore.js'][38] = 0; _$jscoverage['stores/nstore.js'][39] = 0; _$jscoverage['stores/nstore.js'][42] = 0; _$jscoverage['stores/nstore.js'][43] = 0; _$jscoverage['stores/nstore.js'][44] = 0; } _$jscoverage['stores/nstore.js'][12]++; var Store = require("nstore"); _$jscoverage['stores/nstore.js'][14]++; var nStore = module.exports = (function nStore(options) { _$jscoverage['stores/nstore.js'][15]++; options = options || {}; _$jscoverage['stores/nstore.js'][16]++; var path = options.path || process.cwd() + "/store.db"; _$jscoverage['stores/nstore.js'][17]++; this.client = Store(path); }); _$jscoverage['stores/nstore.js'][20]++; nStore.prototype.get = (function (key, fn) { _$jscoverage['stores/nstore.js'][21]++; this.client.get(key, fn); }); _$jscoverage['stores/nstore.js'][24]++; nStore.prototype.set = (function (key, val, fn) { _$jscoverage['stores/nstore.js'][25]++; this.client.save(key, val, fn); }); _$jscoverage['stores/nstore.js'][28]++; nStore.prototype.remove = (function (key, fn) { _$jscoverage['stores/nstore.js'][29]++; this.client.remove(key, fn); }); _$jscoverage['stores/nstore.js'][32]++; nStore.prototype.has = (function (key, fn) { _$jscoverage['stores/nstore.js'][33]++; this.client.get(key, (function (err, val) { _$jscoverage['stores/nstore.js'][34]++; fn(err, ! ! val); })); }); _$jscoverage['stores/nstore.js'][38]++; nStore.prototype.length = (function (fn) { _$jscoverage['stores/nstore.js'][39]++; fn(null, this.client.length); }); _$jscoverage['stores/nstore.js'][42]++; nStore.prototype.clear = (function (fn) { _$jscoverage['stores/nstore.js'][43]++; this.client.clear(); _$jscoverage['stores/nstore.js'][44]++; fn && fn(); }); _$jscoverage['stores/nstore.js'].source = ["","/*!"," * Keys - nStore"," * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var Store = require('nstore');","","var nStore = module.exports = function nStore(options) {"," options = options || {};"," var path = options.path || process.cwd() + '/store.db';"," this.client = Store(path);","};","","nStore.prototype.get = function(key, fn){"," this.client.get(key, fn);","};","","nStore.prototype.set = function(key, val, fn){"," this.client.save(key, val, fn);","};","","nStore.prototype.remove = function(key, fn){"," this.client.remove(key, fn);","};","","nStore.prototype.has = function(key, fn){"," this.client.get(key, function(err, val){"," fn(err, !!val);"," });","};","","nStore.prototype.length = function(fn){"," fn(null, this.client.length);","};","","nStore.prototype.clear = function(fn){"," this.client.clear();"," fn && fn();","};"];