{"_id":"stream-forward","_rev":"293871","name":"stream-forward","description":"Forward stream events.","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"stephenplusplus","email":""}],"time":{"modified":"2021-06-03T18:54:42.000Z","created":"2015-07-07T20:17:50.172Z","3.0.0":"2015-08-19T00:31:10.856Z","2.0.1":"2015-08-17T18:37:49.220Z","2.0.0":"2015-07-12T22:00:21.890Z","1.0.0":"2015-07-07T20:17:50.172Z"},"users":{"vunb":true},"author":"","versions":{"3.0.0":{"name":"stream-forward","version":"3.0.0","description":"Forward stream events.","main":"index.js","scripts":{"test":"mocha test --timeout 5000"},"files":["index.js","license"],"keywords":["stream","forward","event"],"author":"","license":"MIT","dependencies":{"arrify":"^1.0.0","stubs":"^2.0.0"},"devDependencies":{"mocha":"^2.2.5","request":"^2.58.0","through2":"^2.0.0"},"gitHead":"0655dc1411df97fd0b84bf504d37d770eb83827e","_id":"stream-forward@3.0.0","_shasum":"4bd569d08b59b1177e8b6dfaef0af64beae9fd20","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"dist":{"shasum":"4bd569d08b59b1177e8b6dfaef0af64beae9fd20","size":2182,"noattachment":false,"key":"/stream-forward/-/stream-forward-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-forward/download/stream-forward-3.0.0.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"directories":{},"publish_time":1439944270856,"_cnpm_publish_time":1439944270856,"_hasShrinkwrap":false},"2.0.1":{"name":"stream-forward","version":"2.0.1","description":"Forward stream events.","main":"index.js","scripts":{"test":"mocha test --timeout 5000"},"files":["index.js","license"],"keywords":["stream","forward","event"],"author":"","license":"MIT","dependencies":{"array-to-map":"^1.0.2","on-everything":"^1.0.0","stubs":"^2.0.0"},"devDependencies":{"mocha":"^2.2.5","request":"^2.58.0","through2":"^2.0.0"},"gitHead":"b6ac78ea69156eb3b0d281256796aaf02f32d322","_id":"stream-forward@2.0.1","_shasum":"802355840ce73f51b8f8b71b1bd3533dc3811426","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"dist":{"shasum":"802355840ce73f51b8f8b71b1bd3533dc3811426","size":2381,"noattachment":false,"key":"/stream-forward/-/stream-forward-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-forward/download/stream-forward-2.0.1.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"directories":{},"publish_time":1439836669220,"_cnpm_publish_time":1439836669220,"_hasShrinkwrap":false},"2.0.0":{"name":"stream-forward","version":"2.0.0","description":"Forward stream events.","main":"index.js","scripts":{"test":"mocha test --timeout 5000"},"files":["index.js","license"],"keywords":["stream","forward","event"],"author":"","license":"MIT","dependencies":{"array-to-map":"^1.0.2","on-everything":"^1.0.0","stubs":"^2.0.0"},"devDependencies":{"mocha":"^2.2.5","request":"^2.58.0","through2":"^2.0.0"},"gitHead":"177d4469fdf29e990ce7479461a7a0456d4ad366","_id":"stream-forward@2.0.0","_shasum":"7938439f95c192de07eb1986dff9e174098430db","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"dist":{"shasum":"7938439f95c192de07eb1986dff9e174098430db","size":2227,"noattachment":false,"key":"/stream-forward/-/stream-forward-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-forward/download/stream-forward-2.0.0.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"directories":{},"publish_time":1436738421890,"_cnpm_publish_time":1436738421890,"_hasShrinkwrap":false},"1.0.0":{"name":"stream-forward","version":"1.0.0","description":"Forward stream events.","main":"index.js","scripts":{"test":"mocha test --timeout 5000"},"files":["index.js","license"],"keywords":["stream","forward","event"],"author":"","license":"MIT","dependencies":{"stubs":"^2.0.0"},"devDependencies":{"mocha":"^2.2.5","request":"^2.58.0","through2":"^2.0.0"},"gitHead":"2ac0c2adcef104e27151c0b898723e6e0907b2e7","_id":"stream-forward@1.0.0","_shasum":"a5f9e1400deed50f530a58dc039ed54cb529ecbc","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"dist":{"shasum":"a5f9e1400deed50f530a58dc039ed54cb529ecbc","size":1630,"noattachment":false,"key":"/stream-forward/-/stream-forward-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/stream-forward/download/stream-forward-1.0.0.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"directories":{},"publish_time":1436300270172,"_cnpm_publish_time":1436300270172,"_hasShrinkwrap":false}},"readme":"# stream-forward\n\n> Forward events to the next stream in the pipeline.\n\n## Use\n\n```sh\n$ npm install --save stream-forward\n```\n```js\nvar streamForward = require('stream-forward');\n```\n\n## Example\n\n```js\nvar streamForward = require('stream-forward');\nvar request = require('request');\n\nvar opts = {\n  events: ['response']\n};\n\nstreamForward(request('http://yahoo.com'), opts)\n  .pipe(process.stdout)\n  .on('response', function (response) {\n    // `response` from the request stream.\n  });\n```\n\n**Note: don't neglect proper event handling on the individual parts of your stream.**\n\nThis is just a convenience when you have to manually listen and re-emit events across a middleman/spy pipe. Consider the following example:\n\n```js\nvar fs = require('fs');\n\nfunction getRequestStream(reqOpts) {\n  var opts = {\n    events: ['complete']\n  };\n\n  return streamForward(request(reqOpts), opts)\n    .pipe(fs.createWriteStream('./request-cache'));\n}\n\ngetRequestStream('http://yahoo.com')\n  .on('complete', function () {\n    // Without `stream-forward`, this couldn't emit.\n  });\n```\n\n## stream = streamForward(stream, [options]);\n\n\n### stream\n\nType: `Stream`\n\nThe source stream to spy on. This is returned from the function to allow chaining.\n\n\n### options\n\n*Optional.* Configuration options.\n\n\n#### options.continuous\n\nType: `Boolean`\n<br>Default: `false`\n\nIf true, when a new stream is attached to `stream`, it will receive the events emitted by the original.\n\n##### Disabled (default)\n```js\nvar sourceStream = request('http://yahoo.com');\nvar through = require('through2');\n\nstreamForward(sourceStream)\n  .pipe(through())\n  .on('complete', function () {\n    // Called.\n  })\n  .pipe(through())\n  .on('complete', function () {\n    // Not called.\n  });\n```\n\n##### Enabled\n```js\nvar sourceStream = request('http://yahoo.com');\nvar through = require('through2');\n\nstreamForward(sourceStream, { continuous: true })\n  .pipe(through())\n  .on('complete', function () {\n    // Called.\n  })\n  .pipe(through())\n  .on('complete', function () {\n    // Called.\n  });\n```\n\n\n#### options.events\n\nType: `Array`\n\nEvent names to re-emit on attached streams.\n","_attachments":{},"license":"MIT"}