Installations
npm install range-parser
Releases
Unable to fetch releases
Developer
jshttp
Developer Guide
Module System
Unable to determine the module system for this package.
Min. Node Version
>= 0.6
Typescript Support
No
Node Version
8.16.0
NPM Version
6.4.1
Statistics
91 Stars
160 Commits
16 Forks
12 Watching
2 Branches
29 Contributors
Updated on 23 Sept 2024
Bundle Size
0.98 kB
Minified
553.00 B
Minified + Gzipped
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
6,814,627,266
Last day
-2.9%
6,702,246
Compared to previous day
Last week
3.3%
36,382,207
Compared to previous week
Last month
11.8%
149,169,835
Compared to previous month
Last year
6.9%
1,560,728,726
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
range-parser
Range header field parser.
Installation
This is a Node.js module available through the
npm registry. Installation is done using the
npm install
command:
1$ npm install range-parser
API
1var parseRange = require('range-parser')
parseRange(size, header, options)
Parse the given header
string where size
is the size of the selected
representation that is to be partitioned into subranges. An array of subranges
will be returned or negative numbers indicating an error parsing.
-2
signals a malformed header string-1
signals an unsatisfiable range
1// parse header from request
2var subranges = parseRange(size, req.headers.range)
3
4// the type of the subranges
5if (subranges.type === 'bytes') {
6 // the ranges
7 subranges.forEach(function (r) {
8 // do something with r.start and r.end
9 })
10}
Options
These properties are accepted in the options object.
combine
Specifies if overlapping & adjacent subranges should be combined, defaults to
false
. When true
, ranges will be combined and returned as if they were
specified that way in the header.
1parseRange(100, 'bytes=50-55,0-10,5-10,56-60', { combine: true }) 2// => [ 3// { start: 0, end: 10 }, 4// { start: 50, end: 60 } 5// ]
License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
- Info: security policy file detected: github.com/jshttp/.github/SECURITY.md:1
- Warn: no linked content found
- Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/jshttp/.github/SECURITY.md:1
- Info: Found text in security policy: github.com/jshttp/.github/SECURITY.md:1
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:134: update your workflow using https://app.stepsecurity.io/secureworkflow/jshttp/range-parser/ci.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:207: update your workflow using https://app.stepsecurity.io/secureworkflow/jshttp/range-parser/ci.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:219: update your workflow using https://app.stepsecurity.io/secureworkflow/jshttp/range-parser/ci.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:167
- Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:183
- Info: 3 out of 4 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 3 third-party GitHubAction dependencies pinned
- Info: 0 out of 2 npmCommand dependencies pinned
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 2/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Info: topLevel permissions set to 'read-all': .github/workflows/scorecard.yml:18
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
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 2 are checked with a SAST tool
Score
3.8
/10
Last Scanned on 2024-11-18
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