Skip to content

Commit 06e863f

Browse files
committed
Update index.js to use hyperkv
1 parent b2da350 commit 06e863f

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
tmp
22
node_modules
33
data.jawn
4+
hyperkv-examples.js

index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1+
var hyperkv = require('hyperkv')
2+
var hyperlog = require('hyperlog')
3+
var sub = require('subleveldown')
14
var level = require('level')
2-
var hypercore = require('hypercore')
5+
36
var createImportPipeline = require('./lib/import.js')
47

58
module.exports = Jawn
69

710
function Jawn (opts) {
811
if (!opts) opts = {}
912
var db = opts.db || level('data.jawn')
10-
this.core = opts.core || hypercore(db)
13+
var kv = hyperkv({
14+
log: hyperlog(sub(db, 'log'), {valueEncoding: 'json'}),
15+
db: sub(db, 'kv')
16+
})
17+
this.core = opts.core || kv
1118
this.db = this.core.db
1219
}
1320

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828
"parse-input-stream": "^1.0.1",
2929
"path": "~0.12.7",
3030
"tape": "~4.5.1",
31-
"through2": "^2.0.1"
31+
"through2": "^2.0.1",
32+
"hyperkv": "^1.5.2",
33+
"hyperlog": "^4.8.1",
34+
"subleveldown": "^2.1.0"
3235
},
3336
"devDependencies": {
3437
"standard": "^6.0.5",

0 commit comments

Comments
 (0)