{"_id":"@allegiant/httpduplex","_rev":"2-26d9373d762119ec3dd807f31cd34d28","name":"@allegiant/httpduplex","description":"Unifies http request and response streams.","dist-tags":{"latest":"0.3.6"},"versions":{"0.3.5":{"name":"@allegiant/httpduplex","version":"0.3.5","description":"Unifies http request and response streams.","author":{"name":"echopoint","email":"echopoint@tutanota.com"},"contributors":[],"license":"MIT","bugs":{"url":"https://github.com/allegiant-js/httpduplex/issues"},"homepage":"https://github.com/allegiant-js/httpduplex#readme","repository":{"type":"git","url":"git+https://github.com/allegiant-js/httpduplex.git"},"preferGlobal":true,"main":"index.js","engine":{"node":">= 6"},"scripts":{"lint":"eslint .","test":"tape test/*.js","coverage":"tape test/*.js --coverage --coverage-report=lcov","generate-docs":"tryitout && jsdoc -c jsdoc.json"},"devDependencies":{"docdash":"^0.4.0","eslint":"^4.12.1","jsdoc":"^3.5.5","request":"^2.83.0","tape":"^4.8.0","tryitout":"^1.2.2"},"gitHead":"2e19a6544f09fc65d0e40051d2febe1010a9e48b","_id":"@allegiant/httpduplex@0.3.5","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"echopoint","email":"echopoint@tutanota.com"},"dist":{"integrity":"sha512-11OaQL6vwjI64nWSmXXWdBaoqp0VT8C3AaVeDY0NKepgYU24sJtIIMM1gE/ONV0HjHtI2f107h2YL8zy53agMg==","shasum":"80a751366e71c4c6074c6c33733c4ba3011c8d37","tarball":"https://registry.npmjs.org/@allegiant/httpduplex/-/httpduplex-0.3.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICDRzmoN9IiS3f2bXw4SEVzxhSg5Ygi/trWPfjGErahuAiAKFusARl8yRLOo1bHm/OE2sRc2B4mI51AFaXaSz6OI8g=="}]},"maintainers":[{"name":"echopoint","email":"echopoint@tutanota.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/httpduplex-0.3.5.tgz_1514340016245_0.10435191891156137"}},"0.3.6":{"name":"@allegiant/httpduplex","version":"0.3.6","description":"Unifies http request and response streams.","author":{"name":"echopoint","email":"echopoint@tutanota.com"},"contributors":[],"license":"MIT","bugs":{"url":"https://github.com/allegiant-js/httpduplex/issues"},"homepage":"https://github.com/allegiant-js/httpduplex#readme","repository":{"type":"git","url":"git+https://github.com/allegiant-js/httpduplex.git"},"main":"index.js","engine":{"node":">= 6"},"scripts":{"lint":"eslint .","test":"tape test/*.js","coverage":"tape test/*.js --coverage --coverage-report=lcov","generate-docs":"tryitout && jsdoc -c jsdoc.json"},"devDependencies":{"docdash":"^0.4.0","eslint":"^4.12.1","jsdoc":"^3.5.5","request":"^2.83.0","tape":"^4.8.0","tryitout":"^1.2.2"},"gitHead":"168d52e0ac446e851b0a89601293a50f38aa1b73","_id":"@allegiant/httpduplex@0.3.6","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"echopoint","email":"echopoint@tutanota.com"},"dist":{"integrity":"sha512-5zJmqiIFu0YrVu8NPnbKQcJ5Fy8YaTT+tos91HS1ILq6XYci2fWDXM8jQjISnv1Bz46rfJM2SKmzCcTiBcf49w==","shasum":"8f64d42aee0c12ee0db068dfe68ead9101e6ae4e","tarball":"https://registry.npmjs.org/@allegiant/httpduplex/-/httpduplex-0.3.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEnJUJpva48AYiNq4+SLld8uGBuOJZCsy1cB+o4CX7lzAiEA6cZLsuTcfZdPdUZ3U/GnG8OobXibgHWM9p2yk4LB5Pg="}]},"maintainers":[{"name":"gabrielcsapo","email":"gabecsapo@gmail.com"},{"name":"echopoint","email":"echopoint@tutanota.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/httpduplex-0.3.6.tgz_1514342707785_0.005538928788155317"}}},"readme":"# HttpDuplex\n\n> Unifies http request and response streams.\n>> There be 🐲 here! The API and functionality are being cemented, anything before a 1.0.0 release is subject to change.\n\n## Install\n\n```\nnpm install @allegiant/httpduplex\n```\n\n## Usage\n\nThe following example can be found at example/index.js\n\n```\nconst fs = require('fs');\nconst http = require('http');\nconst httpDuplex = require('@allegiant/httpduplex');\n\nvar server = http.createServer(function (req, res) {\n    var dup = new httpDuplex(req, res);\n    console.log(dup.method + ' ' + dup.url); // eslint-disable-line\n\n    if (dup.url == '/') {\n        dup.setHeader('content-type', 'text/plain');\n        if (dup.method === 'POST') {\n            let size = 0;\n            dup.on('data', buf => size += buf.length)\n               .on('end', () => dup.end(size + '\\n'));\n        } else {\n            fs.createReadStream('README.md').pipe(dup);\n        }\n    } else {\n        dup.setHeader('content-type', 'text/html');\n        dup.statusCode = 404;\n        dup.end('Not found');\n    }\n})\n.on('listening', function () {\n    console.log('Listening http://localhost:' + server.address().port + '/'); // eslint-disable-line\n})\n.listen(7000);\n```\n\n\n## Example\n\nRunning the following command will start up a simple http server:\n\n```\nnode example/index.js\n```\n\n## Thanks\n\nThis began as a compatiblity rewrite of [http-duplex](https://github.com/substack/http-duplex).\n\n## Copyright & License\n\nCopyright &copy; 2017 Allegiant. Distributed under the terms of the MIT License, see [LICENSE](https://github.com/allegiant-js/httpduplex/blob/master/LICENSE)\n\nAvailble via [npm](https://www.npmjs.com/package/@allegiant/httpduplex) or [github](https://github.com/allegiant-js/httpduplex).\n","maintainers":[{"name":"gabrielcsapo","email":"gabecsapo@gmail.com"},{"name":"echopoint","email":"echopoint@tutanota.com"}],"time":{"modified":"2022-04-04T13:31:42.655Z","created":"2017-12-27T02:00:17.780Z","0.3.5":"2017-12-27T02:00:17.780Z","0.3.6":"2017-12-27T02:45:08.998Z"},"homepage":"https://github.com/allegiant-js/httpduplex#readme","repository":{"type":"git","url":"git+https://github.com/allegiant-js/httpduplex.git"},"contributors":[],"author":{"name":"echopoint","email":"echopoint@tutanota.com"},"bugs":{"url":"https://github.com/allegiant-js/httpduplex/issues"},"license":"MIT","readmeFilename":"README.md"}