Format HTTP Content-Range headers according to RFC 7233. Version 1.0.0 is the latest and stable. This package provides a simple function to construct Content-Range header strings from numeric components. It is minimal, dependency-free, and focused on server-side use cases. No significant breaking changes or known vulnerabilities as of the release.
npm install http-content-range-formatVerified import paths — ran on the pinned version, not inferred.
Demonstrates formatting Content-Range headers with different range types: first-last, suffix, and unsatisfied.
Ensure all required fields are provided: for a standard range, include 'first' and 'last'; for suffix range, include 'length' and 'last'; for unsatisfied, include 'length' (or 'total' without 'first'/'last').
Provide 'total' when the total size is known; otherwise, it's optional.
Pass an object with required properties: format({ first: 0, last: 499, length: 1234 })Use default import: const format = require('http-content-range-format')No dependency data recorded yet.