Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gregberge/content-range
Parser and formatter for HTTP/1.1 Content-Range header field.
https://github.com/gregberge/content-range
content-range header http
Last synced: 5 days ago
JSON representation
Parser and formatter for HTTP/1.1 Content-Range header field.
- Host: GitHub
- URL: https://github.com/gregberge/content-range
- Owner: gregberge
- License: mit
- Created: 2014-04-10T12:13:56.000Z (almost 11 years ago)
- Default Branch: main
- Last Pushed: 2022-06-18T20:08:04.000Z (over 2 years ago)
- Last Synced: 2025-01-09T10:16:19.228Z (9 days ago)
- Topics: content-range, header, http
- Language: TypeScript
- Homepage:
- Size: 1020 KB
- Stars: 9
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# content-range
![Node.js CI](https://github.com/gregberge/content-range/workflows/Node.js%20CI/badge.svg)
Parser and formatter for HTTP/1.1 Content-Range header field.
## Install
```sh
npm install content-range
```## Usage
```js
import { format, parse } from "content-range";format({
unit: "bytes",
start: 10,
end: 20,
size: 100,
});
// bytes 10-20/100parse("bytes 10-20/100");
// {
// unit: "bytes",
// start: 10,
// end: 20,
// length: 100,
// }
```## License
MIT