Join streams of JSON objects using the unix join command. This allows joining of very large data sets in a stream interface that Node normally can't handle due to memory constraints.
unix-join, like the join command that it relies on, assumes that the inputs are sorted
by the join key. If they are not sorted, the behavior is undefined. The output is unordered.
npm install unix-join
unix-join takes three arguments: two Readable streams of JSON objects (left and right) and an
Valid options are:
- type - the type of join to perform. one of inner, left, right, full. default inner
- on - the fields to join on. can be a string, where it uses the value of that streams from both
streams, or an object of the form
keyis the field to join from in the left stream and
valis the field to join to in the right stream. the value of the field to join on must be a primitive in all cases