parse-content-range-header

0.2.4 • Public • Published

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
}

Package Sidebar

Install

npm i parse-content-range-header

Weekly Downloads

38

Version

0.2.4

License

MIT

Unpacked Size

7.37 kB

Total Files

7

Last publish

Collaborators

  • ferrao