# accept-ranges

> Check if a URL accepts HTTP Range Requests

Latest version **0.0.1** (published 2021-09-26) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install accept-ranges
pnpm add accept-ranges
yarn add accept-ranges
bun add accept-ranges
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2021-09-26 |
| First published | 2020-09-14 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Daniel J. Dufour |
| Maintainers | danieljdufour |
| Keywords | accept, aws, byte, cross-fetch, fetch, range, ranges, request, s3 |

## Links

- npm: https://www.npmjs.com/package/accept-ranges
- Repository: https://github.com/GeoSurge/accept-ranges
- Homepage: https://github.com/GeoSurge/accept-ranges#readme
- Issues: https://github.com/GeoSurge/accept-ranges/issues
- npm.io page: https://npm.io/package/accept-ranges

## Dependencies (1)

- [cross-fetch](https://npm.io/package/cross-fetch.md) ^3.0.6

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2021-09-26
- 0.0.0 — 2020-09-14

## README

# accept-ranges
Check if a URL accepts HTTP Range Requests

# install
```bash
npm install accept-ranges
```

# usage
```javascript
import acceptRanges from 'accept-ranges';

const urlAcceptsRangeRequests = acceptRanges("https://naip-analytic.s3.amazonaws.com/al/2017/100cm/rgbir/30085/m_3008501_ne_16_1_20171018.mrf");
// urlAcceptsRangeRequests is true
```

# debugging
If you would like logging of the requests being made, you can pass in `{ debug: true }`
```javascript
import acceptRanges from 'accept-ranges';

const urlAcceptsRangeRequests = acceptRanges(url, { debug: true });
```

# custom fetching
This library uses [cross-fetch](https://www.npmjs.com/package/cross-fetch) by default for issuing the head
request to check if a url supports byte range requests.  If you'd like to use your own fetching library,
pass in a fetch parameter to the options object like `acceptRanges(url, { fetch: otherFetchFunction })`

---
_Source: https://npm.io/package/accept-ranges · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
