1.0.0 • Published 10 years ago

http-content-range-format v1.0.0

Weekly downloads
980
License
MIT
Repository
github
Last release
10 years ago

http-content-range-format Build Status

Format HTTP Content-Range headers, RFC7233 compilant.

Install

Install the package with npm.

$ npm install http-content-range-format

Usage

format({
  unit: 'items',
  first: 0,
  last: 9,
  length: 100
});
// 'items 0-9/100'

API

.format(obj)

format({ unit: 'items', first: 0, last: 9, length: 100 })
// items 0-9/100

format({ unit: 'items', first: 0, last: 9 })
// items 0-9/*

format({ unit: 'items', length: 100 })
// items */100

License

MIT