mergesort-stream2
Merge sorted data from multiple streams into one using streams 2
Essentially a streams 2 implementation of the excellent mergesort-stream
Installation
This module is installed via npm:
$ npm install mergesort-stream2
Example Usage
var mergesort=through2 = ;// stream that will output the object stream ({num: 42}, {num: 44}, {num: 58})var s1 = ;// stream that will output the object stream ({num: 40}, {num: 41}, {num: 52})var s2 = ;// custom comparator function to help sort the objects{// sort by the 'num' fieldvar _a = anum;var _b = bnum;if _a < _b return -1;if _a > _b return +1;return 0;};// Will output:// { num: 40 }// { num: 41 }// { num: 42 }// { num: 44 }// { num: 52 }// { num: 58 }