# egg-global-header

> Egg plugin for setting response header globally.

Latest version **1.0.1** (published 2018-10-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install egg-global-header
pnpm add egg-global-header
yarn add egg-global-header
bun add egg-global-header
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-10-26 |
| First published | 2018-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 8.0.0 |
| Dependencies | 0 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | XadillaX |
| Maintainers | xadillax |
| Keywords | header, egg, eggPlugin, egg-plugin |

## Links

- npm: https://www.npmjs.com/package/egg-global-header
- Repository: https://github.com/eggjs/egg-global-header
- Homepage: https://github.com/eggjs/egg-global-header#readme
- Issues: https://github.com/eggjs/egg/issues
- npm.io page: https://npm.io/package/egg-global-header

## Recent versions

- 1.0.1 (latest) — 2018-10-26
- 1.0.0 — 2018-05-31

## README

# egg-global-header

[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][codecov-image]][codecov-url]
[![David deps][david-image]][david-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/egg-global-header.svg?style=flat-square
[npm-url]: https://npmjs.org/package/egg-global-header
[travis-image]: https://img.shields.io/travis/eggjs/egg-global-header.svg?style=flat-square
[travis-url]: https://travis-ci.org/eggjs/egg-global-header
[codecov-image]: https://codecov.io/github/eggjs/egg-global-header/coverage.svg?branch=master
[codecov-url]: https://codecov.io/github/eggjs/egg-global-header?branch=master
[david-image]: https://img.shields.io/david/eggjs/egg-global-header.svg?style=flat-square
[david-url]: https://david-dm.org/eggjs/egg-global-header
[snyk-image]: https://snyk.io/test/npm/egg-global-header/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/egg-global-header
[download-image]: https://img.shields.io/npm/dm/egg-global-header.svg?style=flat-square
[download-url]: https://npmjs.org/package/egg-global-header

Egg plugin for setting response header globally.

## Install

```bash
$ npm install --save egg-global-header
```

## Usage

```js
// {app_root}/config/plugin.js
exports.globalHeader = {
  enable: true,
  package: 'egg-global-header',
};
```

## Configuration

Set the response key-value pairs in the plugin configuration:

```js
// {app_root}/config/config.default.js
exports.globalHeader = {
  'Powered-by': '23333',
  'Cache-Control': 'no-cache',
};
```

> **Hint:** The header set by **egg-global-header** won't overwrite existing response header(s).
>
> E.g. if you set `Powered-by` in other place (maybe in controller or other plugins), then your own `Powered-by` header
> will be responsed.

## Questions && Suggestions

Please open an issue [here](https://github.com/eggjs/egg/issues).

## License

[MIT](LICENSE)

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