From f1518cdbf156098d18e2734998f1ffdc2784cb55 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sun, 15 Sep 2019 08:27:21 +0200 Subject: [PATCH] Replace old memdb with level-mem --- index.js | 7 ++++--- package.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 1e05299..1bde99f 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ var kappa = require('kappa-core') var events = require('events') var inherits = require('inherits') -var memdb = require('memdb') +var level = require('level-mem') var thunky = require('thunky') var timestamp = require('monotonic-timestamp') var sublevel = require('subleveldown') @@ -49,7 +49,8 @@ function Cabal (storage, key, opts) { var str = buf.toString('utf8') try { var obj = JSON.parse(str) } catch (err) { return {} } return obj - } + }, + buffer: true } this.maxFeeds = opts.maxFeeds @@ -60,7 +61,7 @@ function Cabal (storage, key, opts) { this.modKey = opts.modKey - this.db = opts.db || memdb() + this.db = opts.db || level() this.kcore = kappa(storage, { valueEncoding: json, encryptionKey: isHypercoreKey(this.key) ? this.key : null diff --git a/package.json b/package.json index 06b4326..9ada872 100644 --- a/package.json +++ b/package.json @@ -41,8 +41,8 @@ "inherits": "^2.0.4", "kappa-core": "^4.0.0", "kappa-view-level": "^2.0.1", + "level-mem": "^5.0.1", "materialized-group-auth": "^1.1.1", - "memdb": "^1.3.1", "monotonic-timestamp": "0.0.9", "once": "^1.4.0", "pump": "^3.0.0",