1.0.2 • Published 8 years ago

range-specifier-parser v1.0.2

Weekly downloads
570
License
MIT
Repository
github
Last release
8 years ago

Range Specifier Parser

npm version build status

A parser to handle Range Pagination Headers.

Inspired by range-parser.

Installation

npm install --save 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

Release

npm version [<newversion> | major | minor | patch] -m "Release %s"

License

MIT

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.2.0

8 years ago

0.1.0

9 years ago

0.0.1

9 years ago