# get-response-headers

> Gets the Response Headers for a URL

Latest version **0.0.0** (published 2021-03-03) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install get-response-headers
pnpm add get-response-headers
yarn add get-response-headers
bun add get-response-headers
```

## 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.0 |
| Published | 2021-03-03 |
| First published | 2021-03-03 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Daniel J. Dufour |
| Maintainers | danieljdufour |
| Keywords | headers, file-type, http, mime |

## Links

- npm: https://www.npmjs.com/package/get-response-headers
- Repository: https://github.com/DanielJDufour/get-response-headers
- Homepage: https://github.com/DanielJDufour/get-response-headers#readme
- Issues: https://github.com/DanielJDufour/get-response-headers/issues
- npm.io page: https://npm.io/package/get-response-headers

## Recent versions

- 0.0.0 (latest) — 2021-03-03

## README

# get-response-headers
> Get the Response Headers for a URL

# Features
- Avoids downloading the whole file
- Works with HTTP and HTTPS
- Zero Dependencies
- Follows 301 Redirects
- Works even when HEAD requests are blocked (because it uses GET)
- Normalizes Response Headers (as camel-cased keys)

# Limitations
- Only works in NodeJS

# Install
```bash
npm install get-response-headers
```

# Usage
```js
const { getResponseHeaders } = require('get-response-headers');

const url = "https://s3-us-west-2.amazonaws.com/planet-disaster-data/hurricane-harvey/SkySat_Freeport_s03_20170831T162740Z3.tif";
const { headers } = await getResponseHeaders({ url });
/*
headers is {
  acceptRanges: 'bytes',
  connection: 'close',
  contentLength: '722512509',
  contentType: 'image/tiff',
  date: 'Wed, 03 Mar 2021 05:53:28 GMT',
  ...
}
*/
```

# Advanced Usage
## Modifying High Water Mark
The High Water Mark is how many bytes to read before returning the result.  The default is 1024.
```js
const { headers } = await getResponseHeaders({ highWaterMark: 512, url });
```

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