5 "/var/www/yaffs/node_modules/phridge"
8 "_from": "fork-stream@>=0.0.4 <0.0.5",
9 "_id": "fork-stream@0.0.4",
12 "_location": "/fork-stream",
14 "email": "deoxxa@fknsrs.biz",
17 "_npmVersion": "1.2.32",
18 "_phantomChildren": {},
20 "name": "fork-stream",
21 "raw": "fork-stream@^0.0.4",
24 "spec": ">=0.0.4 <0.0.5",
30 "_resolved": "https://registry.npmjs.org/fork-stream/-/fork-stream-0.0.4.tgz",
31 "_shasum": "db849fce77f6708a5f8f386ae533a0907b54ae70",
33 "_spec": "fork-stream@^0.0.4",
34 "_where": "/var/www/yaffs/node_modules/phridge",
36 "email": "deoxxa@fknsrs.biz",
37 "name": "Conrad Pankoff",
38 "url": "http://www.fknsrs.biz/"
41 "url": "https://github.com/deoxxa/fork-stream/issues"
44 "description": "Fork a stream in multiple directions according to a function",
51 "shasum": "db849fce77f6708a5f8f386ae533a0907b54ae70",
52 "tarball": "https://registry.npmjs.org/fork-stream/-/fork-stream-0.0.4.tgz"
54 "homepage": "https://github.com/deoxxa/fork-stream#readme",
67 "email": "deoxxa@fknsrs.biz"
70 "name": "fork-stream",
71 "optionalDependencies": {},
72 "readme": "fork-stream [![build status](https://travis-ci.org/deoxxa/fork-stream.png)](https://travis-ci.org/deoxxa/fork-stream)\n===========\n\nFork a stream in multiple directions according to a function.\n\nOverview\n--------\n\nfork-stream basically gives you conditional branching for streams. You supply\nthe logic, fork-stream supplies the streaming.\n\nSuper Quickstart\n----------------\n\nCode:\n\n```javascript\nvar ForkStream = require(\"fork-stream\");\n\nvar fork = new ForkStream({\n classifier: function classify(e, done) {\n return done(null, e.match(/[aeiou]/));\n },\n});\n\nfork.a.on(\"data\", console.log.bind(console, \"vowels:\"));\nfork.b.on(\"data\", console.log.bind(console, \"no vowels:\"));\n\nfork.write(\"hello\");\nfork.write(\"zxcbzz\");\nfork.write(\"ooooooo\");\n\nfork.end();\n```\n\nOutput:\n\n```\nvowels: hello\nno vowels: zxcbzz\nvowels: ooooooo\n```\n\nInstallation\n------------\n\nAvailable via [npm](http://npmjs.org/):\n\n> $ npm install fork-stream\n\nOr via git:\n\n> $ git clone git://github.com/deoxxa/fork-stream.git node_modules/fork-stream\n\nAPI\n---\n\n**constructor**\n\nCreates a new fork-stream.\n\n```javascript\nnew ForkStream(options);\n```\n\n```javascript\nvar fork = new ForkStream({\n highWaterMark: 5,\n classifier: function(e, done) {\n return done(null, !!e);\n },\n});\n```\n\n* _options_ - regular stream options, and a `classifier` property that\n fork-stream will use to decide what output stream to send your object down.\n\nExample\n-------\n\nAlso see [example.js](https://github.com/deoxxa/fork-stream/blob/master/example.js).\n\n```javascript\nvar ForkStream = require(\"fork-stream\");\n\nvar fork = new ForkStream({\n classifier: function classify(e, done) {\n return done(null, e >= 5);\n },\n});\n\nfork.a.on(\"data\", console.log.bind(null, \"a\"));\nfork.b.on(\"data\", console.log.bind(null, \"b\"));\n\nfor (var i=0;i<20;++i) {\n fork.write(Math.round(Math.random() * 10));\n}\n```\n\nOutput:\n\n```\nb 1\na 6\na 9\na 10\na 7\na 5\nb 2\nb 4\na 8\nb 3\na 5\nb 4\na 7\na 8\nb 1\na 6\nb 2\nb 0\na 5\nb 1\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",
73 "readmeFilename": "README.md",
76 "url": "git://github.com/deoxxa/fork-stream.git"
79 "test": "mocha -R tap"