{"_id":"http-enhanced","_rev":"32-cd2a956d8e4fb195ca8c9dc296e7db64","name":"http-enhanced","description":"Drop-in replacement for Node.js standard `http` API with various helpers.","dist-tags":{"latest":"0.6.0"},"versions":{"0.2.1":{"name":"http-enhanced","version":"0.2.1","main":"index.js","description":"Drop-in replacement for Node.js standard `http` API with various helpers.","keywords":["http","enhanced","maximal","helpers","streaming","nodeps"],"homepage":"http://github.com/chbrown/http-enhanced","bugs":"http://github.com/chbrown/http-enhanced/issues","author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"repository":{"type":"git","url":"git://github.com/chbrown/http-enhanced.git"},"_id":"http-enhanced@0.2.1","dist":{"shasum":"2bb18b91272a22e972dbf577a53a51084dd8f283","tarball":"https://registry.npmjs.org/http-enhanced/-/http-enhanced-0.2.1.tgz","integrity":"sha512-l04DIi5rfhpdGQMxGZFH/PaW6HvtsYy/CsTgA43wytqWffRca3j0hdTuZ5l4D167Ci5HJwOPVqayWZpVmQ+ccg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICzrzi2da8eW0nQeLYaLVIg7N3p1ze84X08PlP7nbxSSAiAhAjRP5I0T35RsjV8dg5lE2G+QBVFH6txhk6qeSW7Z3g=="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.2.2":{"name":"http-enhanced","version":"0.2.2","main":"index.js","description":"Drop-in replacement for Node.js standard `http` API with various helpers.","keywords":["http","enhanced","maximal","helpers","streaming","nodeps"],"homepage":"http://github.com/chbrown/http-enhanced","bugs":"http://github.com/chbrown/http-enhanced/issues","author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"repository":{"type":"git","url":"git://github.com/chbrown/http-enhanced.git"},"_id":"http-enhanced@0.2.2","dist":{"shasum":"7b7a75938b15c19da626f44a4ec414d2abdf6894","tarball":"https://registry.npmjs.org/http-enhanced/-/http-enhanced-0.2.2.tgz","integrity":"sha512-8bWPA91G1wfwJLyaVRuddbHaJSMMQvxQiHcIK7+nGneqAHm6vTME4Lfw3rdEzvfdcBQ0hPb4zDMZAZ7tVKk+dQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKRHC7geWGg5d/qVeKULixSObHeLcNOgf91ASW6pi7BwIgKS89EvvFoKoT4030C/DaN8HUtqCzVUbi99aDaCmC26M="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.2.3":{"name":"http-enhanced","version":"0.2.3","main":"index.js","description":"Drop-in replacement for Node.js standard `http` API with various helpers.","keywords":["http","enhanced","maximal","helpers","streaming","nodeps"],"homepage":"http://github.com/chbrown/http-enhanced","bugs":"http://github.com/chbrown/http-enhanced/issues","author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/chbrown/http-enhanced.git"},"_id":"http-enhanced@0.2.3","dist":{"shasum":"da338eaf685f13cd69b1d4f50d341d022b8f2a86","tarball":"https://registry.npmjs.org/http-enhanced/-/http-enhanced-0.2.3.tgz","integrity":"sha512-sYgUcPNn1KEVhv56tfMlhTkfTEaKkJIloyToNGY8MNRaCC9w9QpA6MI6DGzhCtWU5M5Czaw0Y95cG1NubIEu6w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgNvj7HsBooRm7UK8qkACnms3Ca85GzbdH4vfTuttrbgIhAKKX9jV+TkDZprhxrpS3w4/luSPpKsufQxGUpH+oYrrl"}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.3.0":{"name":"http-enhanced","version":"0.3.0","main":"index.js","description":"Drop-in replacement for Node.js standard `http` API with various helpers.","keywords":["http","enhanced","maximal","helpers","streaming","nodeps"],"homepage":"http://github.com/chbrown/http-enhanced","bugs":{"url":"http://github.com/chbrown/http-enhanced/issues"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/chbrown/http-enhanced.git"},"_id":"http-enhanced@0.3.0","dist":{"shasum":"add489f391a5012fe309c71885e810f969ef5776","tarball":"https://registry.npmjs.org/http-enhanced/-/http-enhanced-0.3.0.tgz","integrity":"sha512-hWz6+Gz32pGh32Y9zykr/Mius4zy96/46oY32EZWUxvgzP/sTvHLXd33cll9RbS5gThJ/ZBwbGEINOSazeuE0A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXJ84cwB0hYItRKup5CGRrbNpitWjUcRp4JhVtLfQv6wIgIKNES76RcImy1Ho1b6qzLMjP/xf0Hf5ZVjUKS1y9RxI="}]},"_from":".","_npmVersion":"1.2.25","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.3.1":{"name":"http-enhanced","version":"0.3.1","main":"index.js","description":"Drop-in replacement for Node.js standard `http` API with various helpers.","keywords":["http","enhanced","maximal","helpers","streaming","nodeps"],"homepage":"http://github.com/chbrown/http-enhanced","bugs":{"url":"http://github.com/chbrown/http-enhanced/issues"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/chbrown/http-enhanced.git"},"_id":"http-enhanced@0.3.1","dist":{"shasum":"9207bf173826f057a076db6360ddff316b3f09be","tarball":"https://registry.npmjs.org/http-enhanced/-/http-enhanced-0.3.1.tgz","integrity":"sha512-cU+FiD2jYa5F3FQqBNuaO2kqpbG3MAi0qIMuxSOITOlXgdfCARhVt2sFU7Nskhw6bkyBsaN7kjuPWJwKGMbxFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBc3unGcKZUZF/dYBospLdg56kbqwiUUvhEHqyoKd3sZAiEArRh4XjjI8H0jl5sEEF06jGY/rFHplo//W3nmPOf739A="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.4.0":{"name":"http-enhanced","version":"0.4.0","main":"index.js","description":"Drop-in replacement for Node.js standard `http` API with various helpers.","keywords":["http","enhanced","maximal","helpers","streaming","nodeps"],"homepage":"http://github.com/chbrown/http-enhanced","bugs":{"url":"http://github.com/chbrown/http-enhanced/issues"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/chbrown/http-enhanced.git"},"_id":"http-enhanced@0.4.0","dist":{"shasum":"f99acde339dfc3680abf68e47ec89408d3130b24","tarball":"https://registry.npmjs.org/http-enhanced/-/http-enhanced-0.4.0.tgz","integrity":"sha512-PItxWfErbv38CikoLrEavJFapVH9mLcPKtJxSOBEkFIFgoGLoAC7h9X4YyMWMtMP88pOJm39lhQjzzBSIfy50g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFUN7lSRsbyP/i8wWdVmTXSGxdtbyiQ+QwS3i/gRuAjvAiEA1p9ITjoO0ZvyHS2ThHXjLgt/zPs7U2e7JGVA+BeEqcI="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.4.1":{"name":"http-enhanced","version":"0.4.1","main":"index.js","description":"Drop-in replacement for Node.js standard `http` API with various helpers.","keywords":["http","enhanced","maximal","helpers","streaming","nodeps"],"homepage":"http://github.com/chbrown/http-enhanced","bugs":{"url":"http://github.com/chbrown/http-enhanced/issues"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/chbrown/http-enhanced.git"},"_id":"http-enhanced@0.4.1","dist":{"shasum":"95ded4ac3a1be989d18ea7e1cf76db537cab5d41","tarball":"https://registry.npmjs.org/http-enhanced/-/http-enhanced-0.4.1.tgz","integrity":"sha512-xTrRS7j2jOrQ2zIfd6eZ5vWnN6c63G1pWCXmxfCclM1ZeuFjld9u/yY5eFb6NZW6bX8ksIA8qSZM1hwz9CGzPQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIERURRuCgMOwemyMmxoj8Iq25tgW2CukkCBOlp5xkXUUAiBdYQ+IO+l1Cj5y0pJi8fqLsTSYqAqwxhthjzgU27sr1g=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.4.2":{"name":"http-enhanced","version":"0.4.2","main":"index.js","description":"Drop-in replacement for Node.js standard `http` API with various helpers.","keywords":["http","enhanced","maximal","helpers","streaming","nodeps"],"homepage":"http://github.com/chbrown/http-enhanced","bugs":{"url":"http://github.com/chbrown/http-enhanced/issues"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/chbrown/http-enhanced.git"},"_id":"http-enhanced@0.4.2","dist":{"shasum":"a1c72294de2c6911efc77a19b2089d18d77b8fca","tarball":"https://registry.npmjs.org/http-enhanced/-/http-enhanced-0.4.2.tgz","integrity":"sha512-plTv0qT0xhZs9PnCTmQcYRnwH3bVUGJJzfZ7aGaH8qUt7idiO/Y9lTCT04gXd5/D1XZT1QUjBNnxAqGlrdY/1A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGz1CfweKnK5OQMb/jUKvDW/+i8u0EW+d42+lyqa7KHbAiEAs8JM4mcYO9iTeaE/2DWRoKshlkAdH+hqnZLPeqY+5/A="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.5.0":{"name":"http-enhanced","version":"0.5.0","main":"index.js","description":"Drop-in replacement for Node.js standard `http` API with various helpers.","keywords":["http","enhanced","maximal","helpers","streaming","nodeps"],"homepage":"http://github.com/chbrown/http-enhanced","bugs":{"url":"http://github.com/chbrown/http-enhanced/issues"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/chbrown/http-enhanced.git"},"devDependencies":{"tap":"*","request":"*"},"_id":"http-enhanced@0.5.0","dist":{"shasum":"c219970c065f2adb900b47425e6a4a42bcd97c15","tarball":"https://registry.npmjs.org/http-enhanced/-/http-enhanced-0.5.0.tgz","integrity":"sha512-3k4hzCzI8iyW+i6VKfWtu+IQaFJWvjyqT/37QNNZQw7vb8LaB0BU2Vg0+5w+XsbYC8Jo34Nrn4iwihDRJH8MDg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhJRT4er16aZWX6XVeOSarU8EJ1FGzESpX8OlHRx74CAIgMIZ5/VitzE1XA+De1wKBNELmEKwZP8gZud+YEqhNfxI="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.5.1":{"name":"http-enhanced","version":"0.5.1","main":"index.js","description":"Drop-in replacement for Node.js standard `http` API with various helpers.","keywords":["http","enhanced","maximal","helpers","streaming","nodeps"],"homepage":"http://github.com/chbrown/http-enhanced","bugs":{"url":"http://github.com/chbrown/http-enhanced/issues"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/chbrown/http-enhanced.git"},"devDependencies":{"tap":"*","request":"*"},"scripts":{"test":"tap test"},"gitHead":"0a84d2ef72eb51cabf435f9f8ea5e5460250ce19","_id":"http-enhanced@0.5.1","_shasum":"f440e77e1c517839b2f8ffd277d49578131395d7","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"dist":{"shasum":"f440e77e1c517839b2f8ffd277d49578131395d7","tarball":"https://registry.npmjs.org/http-enhanced/-/http-enhanced-0.5.1.tgz","integrity":"sha512-xohleegNKBxtCk75iJFo+3Nl07S9mbLAGggJKPHxym2BIcrWTOHaZFLOfzF+o/12q3J/c6Wr9Ni3pIqIy/MJ9g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIExfc+rpt1eTxj6cbQWFsqz0xkWlQeZ/xybxTeWNoH5WAiEAg+kUK2LrO4Z99E7nhfZQIcZIlYtPJIcs2UJcZLdorAM="}]},"directories":{}},"0.5.2":{"name":"http-enhanced","version":"0.5.2","main":"index.js","description":"Drop-in replacement for Node.js standard `http` API with various helpers.","keywords":["http","enhanced","maximal","helpers","streaming","nodeps"],"homepage":"http://github.com/chbrown/http-enhanced","bugs":{"url":"http://github.com/chbrown/http-enhanced/issues"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/chbrown/http-enhanced.git"},"devDependencies":{"request":"*","tap":"*"},"scripts":{"test":"tap test"},"gitHead":"2d12d884f7d69f6f1902232631d1b07d56419c89","_id":"http-enhanced@0.5.2","_shasum":"290ee865b90d60d8fef33ce43c2212162007e82e","_from":".","_npmVersion":"2.1.10","_nodeVersion":"0.10.33","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"dist":{"shasum":"290ee865b90d60d8fef33ce43c2212162007e82e","tarball":"https://registry.npmjs.org/http-enhanced/-/http-enhanced-0.5.2.tgz","integrity":"sha512-iiDsEyDJKcuy8Ijt6pNxL2i9JGomdmZTjHCW7+ckG3jcbUZgtINickYEryI1EnxmjThbZGDQ8nw9QgWHARWTeg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEynNDthhXoS50Pysp+xlF9gGwJGUOw7uJQiN03+soioAiAVizULpipWh9NYEpxuC44pjB3xrwgL1I72IFs9n+7rJg=="}]},"directories":{}},"0.5.3":{"name":"http-enhanced","version":"0.5.3","main":"index.js","description":"Drop-in replacement for Node.js standard `http` API with various helpers.","keywords":["http","enhanced","maximal","helpers","streaming","nodeps"],"homepage":"http://github.com/chbrown/http-enhanced","bugs":{"url":"http://github.com/chbrown/http-enhanced/issues"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/chbrown/http-enhanced.git"},"devDependencies":{"request":"*","tap":"*"},"scripts":{"test":"tap test"},"gitHead":"51a448fc7b4ce598ff5c4e30a5487fcc2c11d57b","_id":"http-enhanced@0.5.3","_shasum":"44edc1b3c270fefabf9641a7313c0c0b7bc27c55","_from":".","_npmVersion":"2.1.10","_nodeVersion":"0.10.33","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"dist":{"shasum":"44edc1b3c270fefabf9641a7313c0c0b7bc27c55","tarball":"https://registry.npmjs.org/http-enhanced/-/http-enhanced-0.5.3.tgz","integrity":"sha512-gOPYO+Aw4I7+Cbp3agORunVALF9/k7/3UOAnS5EMF7nU1CoRNgbIGCk+I2oHsw+r3GU8XIjm3sj0N0S/WPO2VA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHLkO4zVFPp9qf6J47AYHvNgUnQueS0m9h94bIwFlXd0AiACww2HOrUu3NRzR+sQk1whgvu90KIDz4jdU0TPNUAb5g=="}]},"directories":{}},"0.6.0":{"name":"http-enhanced","version":"0.6.0","description":"Drop-in replacement for Node.js standard `http` API with various helpers.","keywords":["http","enhanced","maximal","helpers","streaming","nodeps"],"homepage":"http://github.com/chbrown/http-enhanced","author":{"name":"Christopher Brown","email":"io@henrian.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/chbrown/http-enhanced.git"},"devDependencies":{"request":"2.53.0","tap":"0.5.0"},"scripts":{"test":"tap test"},"gitHead":"e1dd6cffd7b6fc9e3f4fca10f169500fa0d69f03","bugs":{"url":"https://github.com/chbrown/http-enhanced/issues"},"_id":"http-enhanced@0.6.0","_npmVersion":"6.4.1","_nodeVersion":"10.11.0","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"dist":{"integrity":"sha512-LeJ3zuCLPr5U8VApFCBOUHIkXlrpuP3U3fGg83KQZhWZAUQhfh7xHMdWQ4HC0ufSt7u+YkJvB1jmmG36NhEpag==","shasum":"c3f32a866fbb5385717c19a85543db87014a4fc3","tarball":"https://registry.npmjs.org/http-enhanced/-/http-enhanced-0.6.0.tgz","fileCount":5,"unpackedSize":18317,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbsQ6QCRA9TVsSAnZWagAAAUIP/j3CEONqGVmmmD+NzITA\n+aaNBywZMk0Pmxw0v0NjB1SNj1iUwacFO4dYPoaw9kfgCWLIb71AxpD5ZsEq\nCmku+4EeYPCieIpbRuslAvyoFkpjdMKJ7w27/7OGXBz/xyMlkfpcumhHJVmG\nEK8NSWIQsDdlpGM+RVuHbZ74mh8UBGXhfoXg3PPgopEm2yEBlpFzrqnv4mIX\nA55c4FAD/aV5876A57V2W1qZJz/3qxwUCOCnYrgCrpxZ6hu97P4G/fsJthNK\ntDFdHxlOAlANsTkU1XNk2j1QHM/jruw8XSvvSRAAzXi6a6vVwnS9AaCkM9xF\nlGviD6dpASVayCP00vEz9oAl4FEUybgzNAV67k0I1z/vEPcP5NJJ0bG6WXwT\nlDNDqM/+Xbax6irlnVMCuU4XGAllaPXaLVD/ZYwh5OCf8iGSz/+szBc92WJq\ngKL+MRTGB8mWsRftAnJfNMwrYTUcE0K6qUxiameLF8Gj5w818u8nDdvhfb89\nyyyRNQzqTjekwUWJduJRGbRdkdlZV7Vxlb+UalOUK98+PtdrmVKFQPWeYvJB\nSTWSirpTBGgt9R1FdQoHKB6MmEchyas51dn/wFtybHfXJ5LWmE5hBhrstLsY\ndfyLT5RTITtcNE4uWXONPlyXnVkB/aZQd2UPABC2Lm3krBViLuRYbKDYpCKC\nu7Y0\r\n=Q5Lm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJsg1/8yD/C9EPj6CTmmGKGdFg8jFlW4gGmbQPnn6tWQIhAIpnBG/A/3tXlOzWY2hW5oxN26XMNdWHvCm3JamV3/SD"}]},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-enhanced_0.6.0_1538330256065_0.19565973307245477"},"_hasShrinkwrap":false}},"readme":"# http-enhanced\n\n[![latest version published to npm](https://badge.fury.io/js/http-enhanced.svg)](https://www.npmjs.com/package/http-enhanced)\n[![Travis CI build status](https://travis-ci.org/chbrown/http-enhanced.svg?branch=master)](https://travis-ci.org/chbrown/http-enhanced)\n\nA drop-in replacement (add-on, really) for Node.js standard library's\n[`http`](http://nodejs.org/api/http.html) module.\n\nIt adds a few methods to the `http.ServerResponse` and `http.IncomingMessage`\nprototypes. If you don't call any of the methods, nothing changes. You'll just\nhave some extra methods lying around that never did anything.\n\n\n## Install\n\nFrom the [npmjs](https://npmjs.org/) registry:\n\n    npm install --save http-enhanced\n\n\n## Usage\n\nMost often, you'll [create a server](http://nodejs.org/api/http.html#http_event_request)\nlike this:\n\n    var http = require('http')\n    http.createServer(function (req, res) {\n\n      // req (request) is an instance of http.IncomingMessage\n      var url = req.url\n\n      // res (response) is an instance of http.ServerResponse\n      res.writeHead(200, {'Content-Type': 'text/html'})\n      res.write('Hello, world!')\n      res.end()\n\n    }).listen(80)\n\nA simple change will let you use some shortcuts:\n\n    var http = require('http-enhanced')\n    http.createServer(function (req, res) {\n\n      // save incoming data to req.data and wait until the request ends,\n      //   or callback immediately (setImmediate) if it already has\n      req.readToEnd('utf8', function(err, data) {\n        var reversed = data.split('').reverse().join('')\n\n        // 1. set HTTP status code to 200,\n        // 2. set the Content-Type header to 'application/json',\n        // 3. and stringify the given object, all in one go:\n        res.json({success: true, message: reversed})\n      })\n\n    }).listen(80)\n\n\n## Request\n\n### request.readToEnd([encoding], [callback])\n\n* `encoding` String | null If specified, callback gets a String instead of a Buffer.\n* `callback` Function | null Call some `function(err, data)` when the request ends.\n    * If only one argument is given, it must be the callback.\n\nRead the request into a buffer until the `end` event is triggered, which will\ntrigger `callback(Error || null, Buffer || null)`. This uses \"new-style\"\nstreams, listening for `readable` events and calling `read()`, coercing to a\nBuffer when needed.\n\nThis function can be called multiple times, with or without the callback.\n\nA popular use case might be if you want to upload a file and do a lot of I/O\nindependently but at the same time. You might call `req.readToEnd()` with no\narguments at the beginning of your request handler, and _then_ set off your\nexpensive I/O calls.\n\nYou can get back a **string** if you specify the encoding, e.g.,\n`req.readToEnd('utf8', function(err, string) { ... })`. This is exactly\nequivalent to calling:\n\n    req.readToEnd(function(err, buffer) {\n      var string = buffer.toString(encoding)\n      ...\n    })\n\nIf the request has already ended, any captured buffer will be immediately\nreturned, via `setImmediate` (which replaced `process.nextTick` in node v0.10).\nThis might occur if you start listening for `data` at some point, in which\ncase the request is flipped to \"old-style\" streams, and `end` might occur\nbefore you listen for it.\n\nFor that reason, and that calling `req.read()` from multiple listeners could\nproduce problems, you should not use either of these:\n\n    req.setEncoding('utf8') // no!\n    req.on('data', function(chunk) { ... }) // robot, NO!\n\nSo you shouldn't call `req.readToEnd()` (without a callback) in your pipeline\nunless you're going to call it again with a callback, later.\n\n### request.readData(callback)\n\nWraps `req.readToEnd()` and uses the request's `Content-Type` header to determine whether to parse the request as JSON or a form querystring.\n\n    callback = function(error, data) { ... }\n\n- `application/json`: Returns result of `JSON.parse`. Interprets empty `application/json` requests as `null`, instead of throwing an Error, since `JSON.parse('')` will raise a SyntaxError normally. If `JSON.parse(body)` throws an error due to invalid JSON, calls back with the error.\n- `application/x-www-form-urlencoded`: Returns result of `querystring.parse`.\n- otherwise, returns the same thing as `readToEnd`, a Buffer.\n\nDoes not work for uploads (use something like [formidable](https://github.com/felixge/node-formidable)).\n\nReturns the parsed querystring for GET requests.\n\n\n## Response\n\n### response.writeEnd(data)\n\n* `data` String String to write to response\n\nThe standard `http` built-in `response.end(data)` is supposed to write the\ndata and then end the response. From the docs:\n\n> If data is specified, it is equivalent to calling\n> `request.write(data, encoding)` followed by `request.end()`.\n\nBut sometimes it doesn't, and `writeEnd` makes sure that's what it really does\n(minus the optional encoding).\n\n    res.writeEnd('Hello world')\n\n### response.writeAll(statusCode, contentType, data)\n\n* `statusCode` Number Three-digit HTTP status code\n* `contentType` String MIME type\n* `data` String String to write to response\n\nRoll `writeHead(statusCode, contentType)` and `writeEnd(data)` all into one:\n\n    res.writeAll(200, 'text/xml', '<root>Haha, not really.</root>')\n\n### response.json(object)\n\n* `object` Object JSON-stringifiable object\n\nWrite response to end with `Content-Type: application/json` and HTTP status\ncode 200, encoding the object with `JSON.stringify`.\n\n    res.json({success: true, message: \"Hello world!\"})\n\nIf `JSON.stringify` throws an error trying to encode your object (e.g., if it\nhas circular references), it will fall back to `util.inspect` with the options:\n`{showHidden: true, depth: null}`.\n\n### response.html(data)\n\n* `data` String HTML to write to response.\n\nSet status code to 200 and `Content-Type` to `text/html`.\n\n    res.html('<p><i>Hello</i> world!.</p>')\n\n### response.text(data)\n\n* `data` String Plain text to write to response.\n\nSet status code to 200 and `Content-Type` to `text/plain`.\n\n    res.text('Hello world.')\n\n### response.die([error])\n\n* `error` String | Error Will call `error.toString()`.\n\nSet status code to 500 (if it's currently 200) and `Content-Type` to\n`text/plain`, using the string representation of the given error, prepended\nwith the label \"Failure: \", as the response body (or just \"Failure\" if no\nerror is provided). If you want to use a 4xx or 5xx status code other than\n500, call, e.g., `.status(418)` before calling `.die()`.\n\n    res.die('Goodbye, cruel world.')\n\n### response.redirect(location)\n\n* `location` String (a URL)\n\nSet status code to given status code (302 by default) and the `Location`\nheader to the given string. Also writes the text,\n\"Redirecting to: /index?error=404\" (or whatever url you use).\n\n    res.redirect('/index?error=404')\n\nTo use a different 3xx status code, set it before calling redirect.\n\n    res.status(303).redirect('/login')\n\n## License\n\nCopyright 2013-2014 Christopher Brown. [MIT Licensed](http://opensource.org/licenses/MIT).\n","maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"time":{"modified":"2022-06-18T22:10:57.721Z","created":"2013-05-20T18:38:26.450Z","0.2.1":"2013-05-20T18:38:26.767Z","0.2.2":"2013-05-21T07:54:01.767Z","0.2.3":"2013-05-27T19:49:22.290Z","0.3.0":"2013-06-13T16:55:10.175Z","0.3.1":"2013-10-08T04:51:07.457Z","0.4.0":"2014-03-11T17:12:41.556Z","0.4.1":"2014-03-29T16:52:44.693Z","0.4.2":"2014-03-29T18:22:14.965Z","0.5.0":"2014-04-02T05:41:50.911Z","0.5.1":"2014-10-14T20:41:10.475Z","0.5.2":"2014-12-03T04:50:31.327Z","0.5.3":"2014-12-16T01:40:22.103Z","0.6.0":"2018-09-30T17:57:36.248Z"},"author":{"name":"Christopher Brown","email":"io@henrian.com"},"repository":{"type":"git","url":"git+https://github.com/chbrown/http-enhanced.git"},"homepage":"http://github.com/chbrown/http-enhanced","keywords":["http","enhanced","maximal","helpers","streaming","nodeps"],"bugs":{"url":"https://github.com/chbrown/http-enhanced/issues"},"license":"MIT","readmeFilename":"README.md","users":{}}