{"name":"http-parser-js","version":"0.5.9","keywords":["http"],"author":{"url":"https://github.com/creationix","name":"Tim Caswell"},"license":"MIT","_id":"http-parser-js@0.5.9","maintainers":[{"name":"creationix","email":"tim@creationix.com"},{"name":"jimbly","email":"wasteland@gmail.com"}],"contributors":[{"url":"https://github.com/Jimbly","name":"Jimb Esser"},{"url":"https://github.com/lrowe","name":"Lawrence Rowe"},{"url":"https://github.com/jscissr","name":"Jan Schär"},{"url":"https://github.com/paulrutter","name":"Paul Rütter"}],"homepage":"https://github.com/creationix/http-parser-js#readme","bugs":{"url":"https://github.com/creationix/http-parser-js/issues"},"dist":{"shasum":"b817b3ca0edea6236225000d795378707c169cec","tarball":"http://registry-npm.ywwl.com/http-parser-js/download/http-parser-js-0.5.9.tgz","fileCount":5,"integrity":"sha512-n1XsPy3rXVxlqxVioEWdC+0+M+SQw0DpJynwtOPo1X+ZlvdzTLtDBIJJlDQTnwZIFJrZSzSGmIOUdP8tu+SgLw==","signatures":[{"sig":"MEUCIFrH17YM8W53ehzepp7QJuVyFzWeAeEa7Ui50vfIQ+lsAiEAigs8lkZ02MZvB54ByJ5AKGAlHaJ4s2En8RlT9JGeGds=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26340,"size":7683,"noattachment":false,"key":"/http-parser-js/-/http-parser-js-0.5.9.tgz"},"main":"http-parser.js","types":"http-parser.d.ts","gitHead":"415b3e40300589b502e04aeb0e85ca0c8b22e9be","scripts":{"test":"python tests/test.py && node tests/iojs/test-http-parser-durability.js","testv12":"python tests/test.py --node-args=\"--http-parser=legacy\" && node --http-parser=legacy tests/iojs/test-http-parser-durability.js"},"_npmUser":{"name":"jimbly","email":"wasteland@gmail.com"},"repository":{"url":"git://github.com/creationix/http-parser-js.git","type":"git"},"_npmVersion":"10.7.0","description":"A pure JS HTTP parser for node.","directories":{},"_nodeVersion":"18.20.4","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/http-parser-js_0.5.9_1736455400936_0.7292720360312632","host":"s3://npm-registry-packages-npm-production"},"readme":"![Node](https://github.com/creationix/http-parser-js/workflows/Node/badge.svg)\n![Node-v12](https://github.com/creationix/http-parser-js/workflows/Node-v12/badge.svg)\n\n# HTTP Parser\n\nThis library parses HTTP protocol for requests and responses.\nIt was created to replace `http_parser.c` since calling C++ functions from JS is really slow in V8.\nHowever, it is now primarily useful in having a more flexible/tolerant HTTP parser when dealing with legacy services that do not meet the strict HTTP parsing rules Node's parser follows.\n\nThis is packaged as a standalone npm module.\nTo use in node, monkeypatch HTTPParser.\n\n```js\n// Monkey patch before you require http for the first time.\nprocess.binding('http_parser').HTTPParser = require('http-parser-js').HTTPParser;\n\nvar http = require('http');\n// ...\n```\n\n## Testing\n\nSimply run `npm test`.\nThe tests are copied from node and mscedex/io.js, with some modifcations.\n\n## Status\n\nThis should now be usable in any node application, it now supports (nearly) everything `http_parser.c` does while still being tolerant with corrupted headers, and other kinds of malformed data.\n\n### Node versions\n\n`http-parser-js` should work via monkey-patching on Node v6-v11, and v13-14.\n\nNode v12.x renamed the internal http parser, and did not expose it for monkey-patching, so to be able to monkey-patch on Node v12, you must run `node --http-parser=legacy file.js` to opt in to the old, monkey-patchable http_parser binding.\n\n## Standalone usage\n\nWhile this module is intended to be used as a replacement for the internal Node.js parser, it can be used as a standalone parser. The [`standalone-example.js`](standalone-example.js) demonstrates how to use the somewhat awkward API (coming from compatibility with the Node.js internals) to parse HTTP from raw Buffers.\n\n## License\n\nMIT.\nSee [LICENSE.md](LICENSE.md)\n","publish_time":1736455401124,"_cnpm_publish_time":1736455401124,"dist-tags":{"latest":"0.5.10"}}