Installations
npm install http-parser-js
Releases
Unable to fetch releases
Developer
creationix
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
Yes
Node Version
16.13.0
NPM Version
8.1.0
Statistics
242 Stars
154 Commits
58 Forks
10 Watching
9 Branches
18 Contributors
Updated on 18 Nov 2024
Languages
JavaScript (85.08%)
Python (14.92%)
Total Downloads
Cumulative downloads
Total Downloads
3,322,606,193
Last day
-3.7%
3,011,956
Compared to previous day
Last week
2.7%
15,958,154
Compared to previous week
Last month
13.5%
66,011,562
Compared to previous month
Last year
1.6%
720,034,930
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
No dependencies detected.
HTTP Parser
This library parses HTTP protocol for requests and responses.
It was created to replace http_parser.c
since calling C++ functions from JS is really slow in V8.
However, 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.
This is packaged as a standalone npm module. To use in node, monkeypatch HTTPParser.
1// Monkey patch before you require http for the first time. 2process.binding('http_parser').HTTPParser = require('http-parser-js').HTTPParser; 3 4var http = require('http'); 5// ...
Testing
Simply run npm test
.
The tests are copied from node and mscedex/io.js, with some modifcations.
Status
This 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.
Node versions
http-parser-js
should work via monkey-patching on Node v6-v11, and v13-14.
Node 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.
Standalone usage
While 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
demonstrates how to use the somewhat awkward API (coming from compatibility with the Node.js internals) to parse HTTP from raw Buffers.
License
MIT. See LICENSE.md
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE.md:0
- Warn: project license file does not contain an FSF or OSI license.
Reason
Found 11/21 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/node-v12.yaml:1
- Warn: no topLevel permission defined: .github/workflows/node.yaml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node-v12.yaml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/creationix/http-parser-js/node-v12.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node-v12.yaml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/creationix/http-parser-js/node-v12.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.yaml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/creationix/http-parser-js/node.yaml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.yaml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/creationix/http-parser-js/node.yaml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/node-v12.yaml:30
- Warn: npmCommand not pinned by hash: .github/workflows/node.yaml:30
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 20 are checked with a SAST tool
Score
3.9
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More