# koa-gzip

> gzip support for koa responses.

Latest version **0.1.0** (published 2014-04-28) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install koa-gzip
pnpm add koa-gzip
yarn add koa-gzip
bun add koa-gzip
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2014-04-28 |
| First published | 2014-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.11.9 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 37 |
| Author | fengmk2 |
| Maintainers | fengmk2 |
| Keywords | koa-gzip, gzip, koa |

## Links

- npm: https://www.npmjs.com/package/koa-gzip
- Repository: https://github.com/node-modules/koa-gzip
- Issues: https://github.com/node-modules/koa-gzip/issues
- npm.io page: https://npm.io/package/koa-gzip

## Dependencies (1)

- [thunkify-wrap](https://npm.io/package/thunkify-wrap.md) 0.1.1

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2014-04-28
- 0.0.4 — 2014-03-23
- 0.0.3 — 2014-03-05
- 0.0.2 — 2014-03-03
- 0.0.1 — 2014-03-03

## README

koa-gzip
=======

[![Build Status](https://secure.travis-ci.org/node-modules/koa-gzip.png)](http://travis-ci.org/node-modules/koa-gzip)

[![Dependency Status](https://gemnasium.com/node-modules/koa-gzip.png)](https://gemnasium.com/node-modules/koa-gzip)

[![NPM](https://nodei.co/npm/koa-gzip.png?downloads=true&stars=true)](https://nodei.co/npm/koa-gzip/)

![logo](https://raw.github.com/node-modules/koa-gzip/master/logo.png)

`gzip` support for [koa](https://github.com/koajs/koa) responses.

## Install

```bash
$ npm install koa-gzip
```

## Usage

```js
var koa = require('koa');
var gzip = require('koa-gzip');

var app = koa();
koa.use(gzip());
```

### gzip always be the last middleware

If you using other response middlewares, like [etag](https://github.com/koajs/etag), just use `gzip` be the first.

```js
app.use(gzip());
app.use(fresh());
app.use(etag());

client => request => gzip() => fresh() => etag() => logic codes
                                                        ||
            client <= gzip() <= fresh() <= etag() <= response
```

## License

(The MIT License)

Copyright (c) 2014 fengmk2 &lt;fengmk2@gmail.com&gt; and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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