{ "_args": [ [ { "raw": "duplexer2@0.0.2", "scope": null, "escapedName": "duplexer2", "name": "duplexer2", "rawSpec": "0.0.2", "spec": "0.0.2", "type": "version" }, "/home/jdaugherty/work/GT2/GT2-Android/node_modules/multipipe" ] ], "_from": "duplexer2@0.0.2", "_id": "duplexer2@0.0.2", "_inCache": true, "_location": "/duplexer2", "_npmUser": { "name": "deoxxa", "email": "deoxxa@fknsrs.biz" }, "_npmVersion": "1.4.3", "_phantomChildren": {}, "_requested": { "raw": "duplexer2@0.0.2", "scope": null, "escapedName": "duplexer2", "name": "duplexer2", "rawSpec": "0.0.2", "spec": "0.0.2", "type": "version" }, "_requiredBy": [ "/multipipe" ], "_resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", "_shasum": "c614dcf67e2fb14995a91711e5a617e8a60a31db", "_shrinkwrap": null, "_spec": "duplexer2@0.0.2", "_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/multipipe", "author": { "name": "Conrad Pankoff", "email": "deoxxa@fknsrs.biz", "url": "http://www.fknsrs.biz/" }, "bugs": { "url": "https://github.com/deoxxa/duplexer2/issues" }, "dependencies": { "readable-stream": "~1.1.9" }, "description": "Like duplexer (http://npm.im/duplexer) but using streams2", "devDependencies": { "chai": "~1.7.2", "mocha": "~1.12.1" }, "directories": {}, "dist": { "shasum": "c614dcf67e2fb14995a91711e5a617e8a60a31db", "tarball": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz" }, "homepage": "https://github.com/deoxxa/duplexer2#readme", "keywords": [ "duplex", "stream", "join", "combine" ], "license": "BSD", "main": "index.js", "maintainers": [ { "name": "deoxxa", "email": "deoxxa@fknsrs.biz" } ], "name": "duplexer2", "optionalDependencies": {}, "readme": "duplexer2 [![build status](https://travis-ci.org/deoxxa/duplexer2.png)](https://travis-ci.org/deoxxa/fork)\n=========\n\nLike duplexer (http://npm.im/duplexer) but using streams2.\n\nOverview\n--------\n\nduplexer2 is a reimplementation of [duplexer](http://npm.im/duplexer) using the\nreadable-stream API which is standard in node as of v0.10. Everything largely\nworks the same.\n\nInstallation\n------------\n\nAvailable via [npm](http://npmjs.org/):\n\n> $ npm install duplexer2\n\nOr via git:\n\n> $ git clone git://github.com/deoxxa/duplexer2.git node_modules/duplexer2\n\nAPI\n---\n\n**duplexer2**\n\nCreates a new `DuplexWrapper` object, which is the actual class that implements\nmost of the fun stuff. All that fun stuff is hidden. DON'T LOOK.\n\n```javascript\nduplexer2([options], writable, readable)\n```\n\n```javascript\nvar duplex = duplexer2(new stream.Writable(), new stream.Readable());\n```\n\nArguments\n\n* __options__ - an object specifying the regular `stream.Duplex` options, as\n well as the properties described below.\n* __writable__ - a writable stream\n* __readable__ - a readable stream\n\nOptions\n\n* __bubbleErrors__ - a boolean value that specifies whether to bubble errors\n from the underlying readable/writable streams. Default is `true`.\n\nExample\n-------\n\nAlso see [example.js](https://github.com/deoxxa/duplexer2/blob/master/example.js).\n\nCode:\n\n```javascript\nvar stream = require(\"stream\");\n\nvar duplexer2 = require(\"duplexer2\");\n\nvar writable = new stream.Writable({objectMode: true}),\n readable = new stream.Readable({objectMode: true});\n\nwritable._write = function _write(input, encoding, done) {\n if (readable.push(input)) {\n return done();\n } else {\n readable.once(\"drain\", done);\n }\n};\n\nreadable._read = function _read(n) {\n // no-op\n};\n\n// simulate the readable thing closing after a bit\nwritable.once(\"finish\", function() {\n setTimeout(function() {\n readable.push(null);\n }, 500);\n});\n\nvar duplex = duplexer2(writable, readable);\n\nduplex.on(\"data\", function(e) {\n console.log(\"got data\", JSON.stringify(e));\n});\n\nduplex.on(\"finish\", function() {\n console.log(\"got finish event\");\n});\n\nduplex.on(\"end\", function() {\n console.log(\"got end event\");\n});\n\nduplex.write(\"oh, hi there\", function() {\n console.log(\"finished writing\");\n});\n\nduplex.end(function() {\n console.log(\"finished ending\");\n});\n```\n\nOutput:\n\n```\ngot data \"oh, hi there\"\nfinished writing\ngot finish event\nfinished ending\ngot end event\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", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git://github.com/deoxxa/duplexer2.git" }, "scripts": { "test": "mocha -R tap" }, "version": "0.0.2" }