@keymetrics/interdb
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -53,7 +53,7 @@ 'use strict' | ||
updateAll (db) { | ||
updateAll (db, cb) { | ||
if (this.getLastUpdate() < db.lastUpdate) { | ||
this.db = db | ||
fs.writeFile(this.path, JSON.stringify(this.db), err => { | ||
console.log(err) | ||
if (typeof cb === 'function') return cb(err) | ||
}) | ||
@@ -60,0 +60,0 @@ } |
{ | ||
"name": "@keymetrics/interdb", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Shared and discoverable database services", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -22,6 +22,7 @@ # InterDB | ||
// DB | ||
con.db.put('key', {}) // put new data in existing key or create it | ||
con.db.del('key') // delete key | ||
con.db.find(/all/g) // find value | ||
con.db.merge('key', {}) // merge values | ||
con.db.put('key', {}, cb) // put new data in existing key or create it | ||
con.db.del('key', cb) // delete key | ||
con.db.get('key') // get value from key | ||
con.db.updateAll({ data: {} }, cb) // Overwrite database | ||
con.db.getLastUpdate() // Get timestamp of latest action | ||
@@ -28,0 +29,0 @@ // Bus |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53730
48