npm install range-specifier-parser[![npm version][npm-image]][npm-url] [![build status][travis-image]][travis-url]
A parser to handle Range Pagination Headers.
_Inspired by range-parser_.
npm install --save range-specifier-parser
The parser receives a byte-ranges-specifier as its only argument.
``javascript
import parser from 'range-specifier-parser';
parser('bytes=0-499');
`
The parser outputs an object with the following properties according to the Byte Ranges spec:
`javascriptfirst-byte-pos
{
first: 0, // .last-byte-pos
last: 499, // .bytes-unit
unit: 'bytes' // .`
}
`sh`
npm test
npm version [
MIT
[npm-image]: https://img.shields.io/npm/v/range-specifier-parser.svg?style=flat-square
[npm-url]: https://npmjs.org/package/range-specifier-parser
[travis-image]: https://img.shields.io/travis/seegno/range-specifier-parser.svg?style=flat-square
[travis-url]: https://travis-ci.org/seegno/range-specifier-parser