UNPKG

kdb-tree-store

Version:

kdb tree implementation using a chunk store

16 lines (13 loc) 314 B
var once = require('once') module.exports = function (stream, cb) { cb = once(cb) var rows = [] stream.once('end', function () { cb(null, rows) }) stream.once('error', cb) read() stream.on('readable', read) function read () { var row = null while (row = stream.read()) rows.push(row) } }