{"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","tarball":"http://registry-npm.ywwl.com/stream-forward/download/stream-forward-1.0.0.tgz","integrity":"sha512-l4gik3SEJ43TpQ50i5yyDRdUKWyu5l9zkYoxm7IU2Bh1aHp62zQINNXMy1GyPDf8HcuzasbrGLSO44zM+YsIpQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkaCvxCtBJk4LSe2ibNLoVDgJYCeU0Pe2CTxWHxojTcQIgfKq2EeTK/LqXKqW8MlHDvzQBqt99GyDW/H3/RSD+XoI="}],"size":1630,"noattachment":false,"key":"/stream-forward/-/stream-forward-1.0.0.tgz"},"maintainers":[{"name":"stephenplusplus","email":"sawchuk@gmail.com"}],"directories":{},"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","publish_time":1436300270172,"_cnpm_publish_time":1436300270172,"dist-tags":{"latest":"3.0.0"}}