0.2.4 • Published 3 years ago

parse-content-range-header v0.2.4

Weekly downloads
88
License
MIT
Repository
github
Last release
3 years ago

parse-content-range-header

Parses an HTTP Content-Range header and returns response range information.

Complements parse-link-header and allows for missing range unit for compatibilitty with headers generated by hapi-pagination

Installation

npm install parse-content-range-header

Usage

const parse = require('parse-content-range-header');

const contentRange = 'items 0-19/30';
console.log(parse(contentRange));
{
    unit: 'items',
    first: 0,
    last: 19,
    length: 30
}
0.2.4

3 years ago

0.2.3

4 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.1

6 years ago