shawnbot / TODO

Somebody hold me accountable to this stuff.
0 stars 0 forks source link

Streaming data joins #13

Open shawnbot opened 8 years ago

shawnbot commented 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);
});
shawnbot commented 8 years ago

Prior art: relational-join-stream and stream-joins.