Open shawnbot opened 8 years ago
Maybe something like this?
var join = require('join-streams'); var foo = createReadStream('foo.csv'); var bar = createReadStream('bar.csv'); join([foo, bar], function(foo, bar) { return foo.x === bar.y; }) .on('data', function(match) { assert.equal(match[0].x, match[1].y); }); // or with named keys join({ left: foo, right: bar }, function(d) { return d.left.x === d.right.y; }) .on('data', function(match) { assert.equal(match.left.x, match.right.y); });
Prior art: relational-join-stream and stream-joins.
Maybe something like this?