JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12870
  • Score
    100M100P100Q165613F
  • License MIT

Content-range header formatter.

Package Exports

  • content-range

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (content-range) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

content-range

Build Status Dependency Status devDependency Status

Content-range header formatter.

Install

npm install content-range

Usage

var contentRange = require('content-range');

var header = contentRange.format({
  unit: 'items',
  first: 10,
  limit: 20,
  length: 100
});

console.log(header); // items 10-29/100

contentRange.format(obj)

Format a content-range header.

var header = contentRange.format({
  unit: 'items',
  first: 10,
  limit: 20,
  length: 100
});

console.log(header); // items 10-29/100

contentRange.parse(str)

Parse a content-range header.

var parts = contentRange.parse('items 10-29/100');

console.log(parts); // { unit: 'items', first: 10, last: 29, length: 100 }

License

MIT