{"id":19019382,"url":"https://github.com/jshttp/range-parser","last_synced_at":"2025-05-16T10:08:11.438Z","repository":{"id":44715132,"uuid":"4627131","full_name":"jshttp/range-parser","owner":"jshttp","description":"Range header field parser","archived":false,"fork":false,"pushed_at":"2024-05-14T17:16:59.000Z","size":74,"stargazers_count":93,"open_issues_count":1,"forks_count":16,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-12T05:04:41.945Z","etag":null,"topics":["http","javascript","nodejs","range"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jshttp.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2012-06-11T16:07:47.000Z","updated_at":"2025-01-27T09:33:10.000Z","dependencies_parsed_at":"2024-05-07T16:28:00.498Z","dependency_job_id":"a6200f3e-f080-41a4-986f-f21b7030a726","html_url":"https://github.com/jshttp/range-parser","commit_stats":{"total_commits":158,"total_committers":8,"mean_commits":19.75,"dds":0.120253164556962,"last_synced_commit":"5fe137dbf0b4ab6e887207895a839d1a0e4d6036"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshttp%2Frange-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshttp%2Frange-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshttp%2Frange-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshttp%2Frange-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jshttp","download_url":"https://codeload.github.com/jshttp/range-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254425677,"owners_count":22069219,"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":["http","javascript","nodejs","range"],"created_at":"2024-11-08T20:12:14.049Z","updated_at":"2025-05-16T10:08:06.429Z","avatar_url":"https://github.com/jshttp.png","language":"JavaScript","readme":"# range-parser\n\n[![NPM Version][npm-version-image]][npm-url]\n[![NPM Downloads][npm-downloads-image]][npm-url]\n[![Node.js Version][node-image]][node-url]\n[![Build Status][ci-image]][ci-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nRange header field parser.\n\n## Installation\n\nThis is a [Node.js](https://nodejs.org/en/) module available through the\n[npm registry](https://www.npmjs.com/). Installation is done using the\n[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):\n\n```sh\n$ npm install range-parser\n```\n\n## API\n\n\u003c!-- eslint-disable no-unused-vars --\u003e\n\n```js\nvar parseRange = require('range-parser')\n```\n\n### parseRange(size, header, options)\n\nParse the given `header` string where `size` is the size of the selected\nrepresentation that is to be partitioned into subranges. An array of subranges\nwill be returned or negative numbers indicating an error parsing.\n\n  * `-2` signals a malformed header string\n  * `-1` signals an unsatisfiable range\n\n\u003c!-- eslint-disable no-undef --\u003e\n\n```js\n// parse header from request\nvar subranges = parseRange(size, req.headers.range)\n\n// the type of the subranges\nif (subranges.type === 'bytes') {\n  // the ranges\n  subranges.forEach(function (r) {\n    // do something with r.start and r.end\n  })\n}\n```\n\n#### Options\n\nThese properties are accepted in the options object.\n\n##### combine\n\nSpecifies if overlapping \u0026 adjacent subranges should be combined, defaults to\n`false`. When `true`, ranges will be combined and returned as if they were\nspecified that way in the header.\n\n\u003c!-- eslint-disable no-undef --\u003e\n\n```js\nparseRange(100, 'bytes=50-55,0-10,5-10,56-60', { combine: true })\n// =\u003e [\n//      { start: 0,  end: 10 },\n//      { start: 50, end: 60 }\n//    ]\n```\n\n## License\n\n[MIT](LICENSE)\n\n[ci-image]: https://badgen.net/github/checks/jshttp/range-parser/master?label=ci\n[ci-url]: https://github.com/jshttp/range-parser/actions/workflows/ci.yml\n[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/range-parser/master\n[coveralls-url]: https://coveralls.io/r/jshttp/range-parser?branch=master\n[node-image]: https://badgen.net/npm/node/range-parser\n[node-url]: https://nodejs.org/en/download\n[npm-downloads-image]: https://badgen.net/npm/dm/range-parser\n[npm-url]: https://npmjs.org/package/range-parser\n[npm-version-image]: https://badgen.net/npm/v/range-parser\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshttp%2Frange-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjshttp%2Frange-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshttp%2Frange-parser/lists"}