# keq-headers

> Set/Append headers to request.

Latest version **2.0.4** (published 2024-05-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install keq-headers
pnpm add keq-headers
yarn add keq-headers
bun add keq-headers
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2024-05-21 |
| First published | 2021-04-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 15.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Val.istar.Guo |
| Maintainers | val.istar.guo |
| Keywords | keq, header, headers, set, append, insert |

## Links

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

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 2.0.4 (latest) — 2024-05-21
- 2.0.3 — 2024-05-13
- 2.0.2 — 2024-05-09
- 2.0.1 — 2023-10-31
- 2.0.0 — 2023-10-30
- 1.0.1 — 2021-07-09
- 1.0.0 — 2021-04-26

## README

# keq-headers

[![version](https://img.shields.io/npm/v/keq-headers.svg?style=for-the-badge)](https://www.npmjs.com/package/keq-headers)
[![downloads](https://img.shields.io/npm/dm/keq-headers.svg?style=for-the-badge)](https://www.npmjs.com/package/keq-headers)
[![license](https://img.shields.io/npm/l/keq-headers.svg?style=for-the-badge)](https://www.npmjs.com/package/keq-headers)
[![dependencies](https://img.shields.io/librariesio/release/npm/keq-headers?style=for-the-badge)](https://www.npmjs.com/package/keq-headers)



<!-- description -->
Set/Append headers to request.
<!-- description -->

## Usage

<!-- usage -->
```typescript
import { request } from 'keq'
import {
  setHeader,
  setHeaders,
  appendHeader,
  appendHeaders,
  insertHeader,
  insertHeaders,
} from 'keq-headers'


request
  .use(setHeader('x-user-name', 'Kerry'))
  .use(appendHeader('x-user-name', 'Marry'))
  .use(insertHeader('x-user-name', 'J'))
  .use(setHeaders({
    'x-user-name': 'Kerry',
    'x-user-id': '1'
  }))
  .use(appendHeaders({
    'x-user-name': 'Marray',
    'x-user-id': '1',
  }))
  .use(insertHeaders({
    'x-user-name': 'J',
    'x-user-id': 1,
  }))
```

 Middleware      | Description
 :---------------|:--------------
 setHeader       | Set a header.If it already exists, the original value will be overwritten.
 setHeaders      | Set headers.If it already exists, the original value will be overwritten.
 appendHeader    | Append a header.
 appendHeaders   | Append headers.
 insertHeader    | Set a header, if it isn't existed.
 insertHeaders   | Set headers, if it isn't existed.
<!-- usage -->

<!-- addition --><!-- addition -->


## Contributing & Development

If there is any doubt, it is very welcome to discuss the issue together.

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