{"_id":"combine-stream","_rev":"63448","name":"combine-stream","description":"Combine multiple duplex streams into just one","dist-tags":{"latest":"0.0.4"},"maintainers":[{"name":"hemanth","email":"hemanth.hm@gmail.com"}],"time":{"modified":"2021-06-03T10:21:28.000Z","created":"2013-09-11T04:52:53.831Z","0.0.4":"2013-12-08T22:32:15.988Z","0.0.3":"2013-09-12T12:35:05.502Z","0.0.2":"2013-09-12T03:28:03.384Z","0.0.1":"2013-09-11T04:52:53.831Z"},"users":{"sirrah":true},"author":{"name":"Conrad Pankoff","email":"deoxxa@fknsrs.biz","url":"http://www.fknsrs.biz/"},"repository":{"type":"git","url":"git://github.com/deoxxa/combine-stream.git"},"versions":{"0.0.4":{"name":"combine-stream","version":"0.0.4","description":"Combine multiple duplex streams into just one","main":"index.js","scripts":{"test":"mocha -R tap"},"repository":{"type":"git","url":"git://github.com/deoxxa/combine-stream.git"},"keywords":["stream","combine","aggregate"],"author":{"name":"Conrad Pankoff","email":"deoxxa@fknsrs.biz","url":"http://www.fknsrs.biz/"},"license":"BSD","bugs":{"url":"https://github.com/deoxxa/combine-stream/issues"},"devDependencies":{"chai":"~1.7.2","mocha":"~1.12.1","sinon":"~1.7.3"},"dependencies":{"readable-stream":"~1.1.9"},"readmeFilename":"README.md","_id":"combine-stream@0.0.4","dist":{"shasum":"34d19bc28a15001af7875424af2768b36a05dd1d","size":3856,"noattachment":false,"key":"/combine-stream/-/combine-stream-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/combine-stream/download/combine-stream-0.0.4.tgz"},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"deoxxa","email":"deoxxa@fknsrs.biz"},"maintainers":[{"name":"hemanth","email":"hemanth.hm@gmail.com"}],"directories":{},"publish_time":1386541935988,"_cnpm_publish_time":1386541935988,"_hasShrinkwrap":false},"0.0.3":{"name":"combine-stream","version":"0.0.3","description":"Combine multiple duplex streams into just one","main":"index.js","scripts":{"test":"mocha -R tap"},"repository":{"type":"git","url":"git://github.com/deoxxa/combine-stream.git"},"keywords":["stream","combine","aggregate"],"author":{"name":"Conrad Pankoff","email":"deoxxa@fknsrs.biz","url":"http://www.fknsrs.biz/"},"license":"BSD","bugs":{"url":"https://github.com/deoxxa/combine-stream/issues"},"devDependencies":{"chai":"~1.7.2","mocha":"~1.12.1","sinon":"~1.7.3"},"dependencies":{"readable-stream":"git://github.com/deoxxa/readable-stream#fix-issue-66"},"readmeFilename":"README.md","_id":"combine-stream@0.0.3","dist":{"shasum":"2de1331daab52f8db2d5eec2448869745fa9123e","size":3855,"noattachment":false,"key":"/combine-stream/-/combine-stream-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/combine-stream/download/combine-stream-0.0.3.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"deoxxa","email":"deoxxa@fknsrs.biz"},"maintainers":[{"name":"hemanth","email":"hemanth.hm@gmail.com"}],"directories":{},"publish_time":1378989305502,"_cnpm_publish_time":1378989305502,"_hasShrinkwrap":false},"0.0.2":{"name":"combine-stream","version":"0.0.2","description":"Combine multiple duplex streams into just one","main":"index.js","scripts":{"test":"mocha -R tap"},"repository":{"type":"git","url":"git://github.com/deoxxa/combine-stream.git"},"keywords":["stream","combine","aggregate"],"author":{"name":"Conrad Pankoff","email":"deoxxa@fknsrs.biz","url":"http://www.fknsrs.biz/"},"license":"BSD","bugs":{"url":"https://github.com/deoxxa/combine-stream/issues"},"devDependencies":{"chai":"~1.7.2","mocha":"~1.12.1","sinon":"~1.7.3"},"dependencies":{"readable-stream":"git://github.com/deoxxa/readable-stream#fix-issue-66"},"readmeFilename":"README.md","_id":"combine-stream@0.0.2","dist":{"shasum":"daa8ef1770941ee9d65710ba68a5771a6f50b242","size":4013,"noattachment":false,"key":"/combine-stream/-/combine-stream-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/combine-stream/download/combine-stream-0.0.2.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"deoxxa","email":"deoxxa@fknsrs.biz"},"maintainers":[{"name":"hemanth","email":"hemanth.hm@gmail.com"}],"directories":{},"publish_time":1378956483384,"_cnpm_publish_time":1378956483384,"_hasShrinkwrap":false},"0.0.1":{"name":"combine-stream","version":"0.0.1","description":"Combine multiple duplex streams into just one","main":"index.js","scripts":{"test":"mocha -R tap"},"repository":{"type":"git","url":"git://github.com/deoxxa/combine-stream.git"},"keywords":["stream","combine","aggregate"],"author":{"name":"Conrad Pankoff","email":"deoxxa@fknsrs.biz","url":"http://www.fknsrs.biz/"},"license":"BSD","bugs":{"url":"https://github.com/deoxxa/combine-stream/issues"},"devDependencies":{"chai":"~1.7.2","mocha":"~1.12.1"},"dependencies":{"readable-stream":"git://github.com/deoxxa/readable-stream#fix-issue-66"},"readmeFilename":"README.md","_id":"combine-stream@0.0.1","dist":{"shasum":"72a3b6da57c3f4a5d0e3337324686bd1db65abff","size":3737,"noattachment":false,"key":"/combine-stream/-/combine-stream-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/combine-stream/download/combine-stream-0.0.1.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"deoxxa","email":"deoxxa@fknsrs.biz"},"maintainers":[{"name":"hemanth","email":"hemanth.hm@gmail.com"}],"directories":{},"publish_time":1378875173831,"_cnpm_publish_time":1378875173831,"_hasShrinkwrap":false}},"readme":"combine-stream [![build status](https://travis-ci.org/deoxxa/combine-stream.png)](https://travis-ci.org/deoxxa/combine-stream)\n===============\n\nCombine multiple duplex streams into just one.\n\nOverview\n--------\n\ncombine-stream lets you treat a few streams as just one, in a parallel fashion.\nWhen you combine a bunch of streams, you write to it as if it was one, and read\nfrom it as if it was one, but you are simultaneously writing to all the streams\nand getting the output from all the streams.\n\nError events are also aggregated from all the streams and forwarded up through\nthe combining stream for you to listen to in one place.\n\nSuper Quickstart\n----------------\n\nCode:\n\n```javascript\nvar stream = require(\"stream\");\n\nvar CombineStream = require(\"combine-stream\");\n\nvar streamA = new stream.PassThrough({objectMode: true}),\n    streamB = new stream.PassThrough({objectMode: true}),\n    streamC = new stream.PassThrough({objectMode: true});\n\nvar combine = new CombineStream([streamA, streamB, streamC]);\n\ncombine.on(\"data\", console.log);\n\ncombine.write(\"hello\");\n\ncombine.end();\n```\n\nOutput:\n\n```\nhello\nhello\nhello\n```\n\nInstallation\n------------\n\nAvailable via [npm](http://npmjs.org/):\n\n> $ npm install combine-stream\n\nOr via git:\n\n> $ git clone git://github.com/deoxxa/combine-stream.git node_modules/combine-stream\n\n**NOTE:**\n\nCurrently this is relying on [my fork of readable-stream](https://github.com/deoxxa/readable-stream/tree/fix-issue-66).\nHopefully my patch gets merged and I can remove the hardcoded github dependency.\n\nAPI\n---\n\n**constructor**\n\nCreates a new combine-stream.\n\n```javascript\nnew CombineStream(options);\n```\n\n```javascript\nvar combine = new CombineStream({\n  logSize: 100,\n  recordDuplicates: true,\n  comparator: functon compare(a, b) {\n    return a === b;\n  },\n});\n```\n\nArguments\n\n* _options_ - an object containing, as well as the regular `TransformStream`\n  options, the parameters described below. If this argument is an array, it will\n  be wrapped in `{streams: ...}`.\n\n_options_\n\n* _streams_ - an array of streams to add at instantiation time.\n* _bubbleErrors_ - a boolean value specifying whether to bubble errors up from\n  the wrapped streams.\n\nExample\n-------\n\nAlso see [example.js](https://github.com/deoxxa/combine-stream/blob/master/example.js).\n\n```javascript\nvar stream = require(\"stream\");\n\nvar CombineStream = require(\"combine-stream\");\n\nvar delayed = function delayed(n) {\n  var s = new stream.Transform({objectMode: true});\n\n  s._transform = function _transform(input, encoding, done) {\n    var self = this;\n\n    return setTimeout(function() {\n      self.push(input + \" \" + n);\n\n      return done();\n    }, n);\n  };\n\n  s._flush = function _flush(done) {\n    console.log(\"ending!\", n);\n\n    setTimeout(done, n);\n  };\n\n  return s;\n};\n\nvar combine = new CombineStream();\n\nvar streamA = delayed(100),\n    streamB = delayed(500);\n\nvar combine = new CombineStream([streamA, streamB]);\n\ncombine.on(\"data\", console.log);\ncombine.on(\"error\", console.log);\n\ncombine.write(\"hello 1\");\ncombine.write(\"hello 2\");\ncombine.write(\"hello 3\");\n\ncombine.end(function() {\n  console.log(\"everything finished\");\n});\n```\n\nOutput:\n\n```\nhello 1 100\nhello 1 500\nhello 2 100\nhello 2 500\nhello 3 100\nhello 3 500\nending! 100\nending! 500\neverything finished\n```\n\nLicense\n-------\n\n3-clause BSD. A copy is included with the source.\n\nContact\n-------\n\n* GitHub ([deoxxa](http://github.com/deoxxa))\n* Twitter ([@deoxxa](http://twitter.com/deoxxa))\n* Email ([deoxxa@fknsrs.biz](mailto:deoxxa@fknsrs.biz))\n","_attachments":{},"readmeFilename":"README.md","bugs":{"url":"https://github.com/deoxxa/combine-stream/issues"},"license":"BSD"}