{"name":"range-parser","author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca","url":"http://tjholowaychuk.com"},"description":"Range header field string parser","version":"1.3.0","contributors":[{"name":"Douglas Christopher Wilson","email":"doug@somethingdoug.com"},{"name":"James Wyatt Cready","email":"wyatt.cready@lanetix.com"},{"name":"Jonathan Ong","email":"me@jongleberry.com","url":"http://jongleberry.com"}],"license":"MIT","keywords":["range","parser","http"],"repository":{"type":"git","url":"git+https://github.com/jshttp/range-parser.git"},"funding":{"type":"opencollective","url":"https://opencollective.com/express"},"devDependencies":{"deep-equal":"1.0.1","eslint":"6.0.1","eslint-config-standard":"13.0.1","eslint-plugin-markdown":"1.0.0","eslint-plugin-import":"2.18.0","eslint-plugin-node":"9.1.0","eslint-plugin-promise":"4.2.1","eslint-plugin-standard":"4.0.0","mocha":"6.1.4","nyc":"14.1.1"},"engines":{"node":">= 0.6"},"scripts":{"lint":"eslint --plugin markdown --ext js,md .","test":"mocha --reporter spec","test-ci":"nyc --reporter=lcovonly --reporter=text npm test","test-cov":"nyc --reporter=html --reporter=text npm test"},"gitHead":"855f5b1fa37340263fe009137d74346088f81c85","_id":"range-parser@1.3.0","bugs":{"url":"https://github.com/jshttp/range-parser/issues"},"homepage":"https://github.com/jshttp/range-parser#readme","_nodeVersion":"26.3.1","_npmVersion":"11.16.0","dist":{"integrity":"sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==","shasum":"d7f19be812bb62721472b45d3be219ef09572b47","tarball":"http://registry-npm.ywwl.com/range-parser/download/range-parser-1.3.0.tgz","fileCount":5,"unpackedSize":8967,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAXXdbiV5Gka2hjQHHXfGfZ/bttss6cbduz027mjk7UhAiEA11W9uiSBsJT5sIMjtfhrc8G12Ek5oTabyx2Uh5Bdnlo="}],"size":3783,"noattachment":false,"key":"/range-parser/-/range-parser-1.3.0.tgz"},"_npmUser":{"name":"blakeembrey","email":"hello@blakeembrey.com"},"directories":{},"maintainers":[{"name":"ulisesgascon","email":"ulisesgascondev@gmail.com"},{"name":"blakeembrey","email":"hello@blakeembrey.com"},{"name":"tjholowaychuk","email":"tj@vision-media.ca"},{"name":"dougwilson","email":"doug@somethingdoug.com"},{"name":"jonathanong","email":"jonathanrichardong@gmail.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/range-parser_1.3.0_1782420941746_0.8936237495783166"},"_hasShrinkwrap":false,"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<!-- eslint-disable no-unused-vars -->\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<!-- eslint-disable no-undef -->\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 & 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<!-- eslint-disable no-undef -->\n\n```js\nparseRange(100, 'bytes=50-55,0-10,5-10,56-60', { combine: true })\n// => [\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","publish_time":1782420941875,"_cnpm_publish_time":1782420941875,"dist-tags":{"latest":"1.3.0"}}