Socket
Socket
Sign inDemoInstall

@keymetrics/interdb

Package Overview
Dependencies
Maintainers
4
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@keymetrics/interdb - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

17

lib/db.js

@@ -39,5 +39,5 @@ 'use strict'

fs.writeFile(this.path, JSON.stringify(this.db), err => {
cb(err)
if (typeof cb === 'function') return cb(err)
})
this.clients.broadcast('command:updateDb', this.db)
this.interdb.clients.broadcast('command:updateDb', this.db)
}

@@ -49,5 +49,5 @@

fs.writeFile(this.path, JSON.stringify(this.db), err => {
cb(err)
if (typeof cb === 'function') return cb(err)
})
this.clients.broadcast('command:updateDb', this.db)
this.interdb.clients.broadcast('command:updateDb', this.db)
}

@@ -64,2 +64,11 @@

push (key, value, cb) {
if (!Array.isArray(this.db.data[key])) return cb(new Error(`${key} is not an array`))
this.db.data[key].push(value)
fs.writeFile(this.path, JSON.stringify(this.db), err => {
if (typeof cb === 'function') return cb(err)
})
}
// Timestamp

@@ -66,0 +75,0 @@

{
"name": "@keymetrics/interdb",
"version": "0.0.3",
"version": "0.0.4",
"description": "Shared and discoverable database services",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -22,3 +22,4 @@ # InterDB

// DB
con.db.put('key', {}, cb) // put new data in existing key or create it
con.db.put('key', 'value', cb) // put new data in existing key or create it
con.db.push('key', 'value', cb) // push data in existing key if it's an array
con.db.del('key', cb) // delete key

@@ -25,0 +26,0 @@ con.db.get('key') // get value from key

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc