HTTP Range Header Parser
JSON →range-parser is a foundational utility within the Node.js ecosystem, specifically designed for parsing the HTTP `Range` header field. This header is crucial for implementing partial content responses (HTTP 206 Partial Content), enabling clients to request specific byte ranges of a resource, which is essential for video streaming, resumable downloads, and efficient data retrieval. Currently at stable version 1.2.1, it provides a straightforward API to transform a `Range` header string into a structured array of byte range objects, each with `start` and `end` properties. A key characteristic is its error handling mechanism, which returns negative integer codes (e.g., -1 for unsatisfiable ranges, -2 for malformed headers) instead of throwing exceptions, requiring developers to explicitly check the return type. It offers a `combine` option to automatically merge overlapping or adjacent ranges for simplified processing. As part of the `jshttp` organization, the package is mature and highly stable, receiving updates primarily for maintenance and minor enhancements rather than frequent new feature releases, making it a reliable choice for server-side range parsing.
Traffic · last 30 days ↓12% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇷 France