uphold/range-specifier-parser

Name: range-specifier-parser

Owner: Uphold

Description: Range Specifier Parser

Created: 2015-01-27 18:21:35.0

Updated: 2017-07-18 17:19:38.0

Pushed: 2016-05-18 17:35:46.0

Homepage: null

Size: 12

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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.

rt parser from 'range-specifier-parser';

er('bytes=0-499');
Output

The parser outputs an object with the following properties according to the Byte Ranges spec:


rst: 0, // `first-byte-pos`.
st: 499, // `last-byte-pos`.
it: 'bytes' // `bytes-unit`.

Running tests
test
Release

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

License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.