{"id":13634789,"url":"https://github.com/creationix/http-parser-js","last_synced_at":"2025-05-14T03:06:34.189Z","repository":{"id":4081879,"uuid":"5187723","full_name":"creationix/http-parser-js","owner":"creationix","description":"A pure JS HTTP parser for node.","archived":false,"fork":false,"pushed_at":"2025-04-08T14:12:29.000Z","size":499,"stargazers_count":245,"open_issues_count":6,"forks_count":59,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-28T10:56:51.960Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"hubtee/awesome-opensource-documents","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/creationix.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2012-07-26T04:20:46.000Z","updated_at":"2025-04-27T00:13:21.000Z","dependencies_parsed_at":"2025-01-24T20:00:36.995Z","dependency_job_id":"8474387e-f172-4545-95fb-11ee39a1312a","html_url":"https://github.com/creationix/http-parser-js","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fhttp-parser-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fhttp-parser-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fhttp-parser-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/creationix%2Fhttp-parser-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/creationix","download_url":"https://codeload.github.com/creationix/http-parser-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252399537,"owners_count":21741670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T00:00:34.167Z","updated_at":"2025-05-14T03:06:34.058Z","avatar_url":"https://github.com/creationix.png","language":"JavaScript","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","funding_links":[],"categories":["net protocol (网络库)"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreationix%2Fhttp-parser-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcreationix%2Fhttp-parser-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcreationix%2Fhttp-parser-js/lists"}