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.4 to 0.0.5

6

lib/db.js

@@ -63,5 +63,7 @@ 'use strict'

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

@@ -68,0 +70,0 @@ if (typeof cb === 'function') return cb(err)

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

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

@@ -23,3 +23,3 @@ # InterDB

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.push('key', 'value', cb) // push data in existing key if it's an array or create an array with value in first index
con.db.del('key', cb) // delete key

@@ -26,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