Package Exports
- range-specifier-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-specifier-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 Specifier Parser
A parser to handle Range Pagination Headers.
Inspired by range-parser.
Installation
Choose your preferred method:
- npm:
npm install --save range-specifier-parser - Download: range-specifier-parser
Usage
The parser receives a byte-ranges-specifier as its only argument.
import parser from 'range-specifier-parser';
parser('bytes=0-499');
Output
The parser outputs an object with the following properties according to the Byte Ranges spec:
{
first: 0, // `first-byte-pos`.
last: 499, // `last-byte-pos`.
unit: 'bytes' // `bytes-unit`.
}
Running tests
npm test