Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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/100

parse("bytes 10-20/100");
// {
// unit: "bytes",
// start: 10,
// end: 20,
// length: 100,
// }
```

## License

MIT