{"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","tarball":"http://registry-npm.ywwl.com/stream-forward/download/stream-forward-2.0.0.tgz","integrity":"sha512-Ic87c5CKq6wW2wMGwtibm0f7BGMwzY/A19nAuIjmby+Y0p46LTwc2bt/c6LwPTngsh7r8lXPVyIMIg0QJ0kqfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFv4VZsPOUaTc559qjEsa0jXnQco4QOZ7WwlovpBy8BqAiEA/AAEVcVK7LFr4YJlO/hAtAHcFLTh7kDzjF4M7TrNxcA="}],"size":2227,"noattachment":false,"key":"/stream-forward/-/stream-forward-2.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":1436738421890,"_cnpm_publish_time":1436738421890,"dist-tags":{"latest":"3.0.0"}}