pull-level
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -36,3 +36,3 @@ | ||
return read(db, opts) | ||
return cat([read(db, opts), live(db, opts) ]) | ||
return cat([read(db, opts), live(db, opts)]) | ||
} | ||
@@ -39,0 +39,0 @@ |
{ | ||
"name": "pull-level", | ||
"description": "", | ||
"version": "1.0.1", | ||
"description": "pull-stream interface to levelup", | ||
"version": "1.0.2", | ||
"homepage": "https://github.com/dominictarr/pull-level", | ||
@@ -11,7 +11,12 @@ "repository": { | ||
"dependencies": { | ||
"level-fix-range": "~1.1" | ||
"level-fix-range": "~1.1", | ||
"pull-stream": "~2.10", | ||
"pull-pushable": "~1.0.2", | ||
"pull-window": "~1.0.1", | ||
"pull-cat": "~1.0" | ||
}, | ||
"devDependencies": { | ||
"monotonic-timestamp": "0.0.8", | ||
"levelup": "git://github.com/dominictarr/node-levelup.git#installable-reverse" | ||
"levelup": "git://github.com/dominictarr/node-levelup.git#installable-reverse", | ||
"level-sublevel": "~4.1.0" | ||
}, | ||
@@ -18,0 +23,0 @@ "scripts": { |
@@ -48,5 +48,7 @@ var pull = require('pull-stream') | ||
var ts = 0 | ||
exports.timestamps = function (db, n, cb) { | ||
var all = [] | ||
pull.infinite() | ||
.pipe(pull.take(n)) | ||
.pipe(pull.map(function (e) { | ||
@@ -58,3 +60,2 @@ return { | ||
})) | ||
.pipe(pull.take(n)) | ||
.pipe(pull.through(function (e) { | ||
@@ -61,0 +62,0 @@ all.push({key:e.key, value: e.value}) |
@@ -24,27 +24,34 @@ | ||
l.read(db, {tail: true}) | ||
.pipe(pull.take(20)) | ||
.pipe(pull.asyncMap(function (e, cb) { | ||
setTimeout(function () { | ||
cb(null, e) | ||
}, 5) | ||
})) | ||
.pipe(pull.through(function (e) { | ||
console.log(e, i++) | ||
})) | ||
.pipe(function (read) { | ||
return function (abort, cb) { | ||
read(abort, function (end, data) { | ||
cb(end, data) | ||
}) | ||
} | ||
}) | ||
.pipe(pull.take(20, true)) | ||
.pipe(pull.collect(function (err, ary) { | ||
t.notOk(err) | ||
t.ok(second) | ||
t.equal(ary.length, all.length) | ||
t.equal(ary.length, 20) | ||
t.deepEqual(ary, all) | ||
t.deepEqual(ary, h.sort(ary.slice())) | ||
t.end() | ||
process.nextTick(function () { | ||
t.notOk(err) | ||
t.ok(second) | ||
console.log(all) | ||
t.equal(ary.length, 20) | ||
t.equal(ary.length, all.length) | ||
t.deepEqual(ary, h.sort(ary.slice())) | ||
t.deepEqual(ary.map(function (e) { | ||
return {key: e.key, value: e.value} | ||
}), all) | ||
t.end() | ||
}) | ||
})) | ||
h.timestamps(db, 10, function (err, _all) { | ||
second = true | ||
all = all.concat(_all) | ||
}) | ||
setTimeout(function () { | ||
h.timestamps(db, 10, function (err, _all) { | ||
second = true | ||
all = all.concat(_all) | ||
console.log('all', all, all.length) | ||
}) | ||
}, 100) | ||
}) | ||
}) |
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
10430
251
5
3
+ Addedpull-cat@~1.0
+ Addedpull-pushable@~1.0.2
+ Addedpull-stream@~2.10
+ Addedpull-window@~1.0.1
+ Addeddeep-equal@0.0.0(transitive)
+ Addeddefined@0.0.0(transitive)
+ Addedjsonify@0.0.1(transitive)
+ Addedpull-cat@1.0.3(transitive)
+ Addedpull-core@1.0.0(transitive)
+ Addedpull-pushable@1.0.3(transitive)
+ Addedpull-stream@2.10.2(transitive)
+ Addedpull-window@1.0.3(transitive)
+ Addedtape@0.3.3(transitive)