Package Exports
- range-parser
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (range-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
range-parser
Range header field parser.
Installation
$ npm install range-parserAPI
var parseRange = require('range-parser')parseRange(size, header)
Parse the given header string where size is the maximum size of the resource.
An array of ranges will be returned or negative numbers indicating an error parsing.
-2signals a malformed header string-1signals an unsatisfiable range
// parse header from request
var range = parseRange(req.headers.range)
// the type of the range
if (range.type === 'bytes') {
// the ranges
range.forEach(function (r) {
// do something with r.start and r.end
})
}