# http-gzip-maybe

> Compress an HTTP response if the client has headers that allow it

Latest version **1.0.0** (published 2017-07-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install http-gzip-maybe
pnpm add http-gzip-maybe
yarn add http-gzip-maybe
bun add http-gzip-maybe
```

## 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.0 |
| Published | 2017-07-12 |
| First published | 2017-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | yoshuawuyts |
| Keywords | compress, maybe, gunzip-maybe |

## Links

- npm: https://www.npmjs.com/package/http-gzip-maybe
- Repository: https://github.com/yoshuawuyts/http-gzip-maybe
- Homepage: https://github.com/yoshuawuyts/http-gzip-maybe#readme
- Issues: https://github.com/yoshuawuyts/http-gzip-maybe/issues
- npm.io page: https://npm.io/package/http-gzip-maybe

## Dependencies (1)

- [readable-stream](https://npm.io/package/readable-stream.md) ^2.3.3

## 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

- 1.0.0 (latest) — 2017-07-12

## README

# http-gzip-maybe [![stability][0]][1]
[![npm version][2]][3] [![build status][4]][5]
[![downloads][8]][9] [![js-standard-style][10]][11]

Compress an HTTP response if the client has headers that allow it

## Usage
```js
var gzipMaybe = require('http-gzip-maybe')
var http = require('http')
var pump = require('pump')

http.createServer(function (req, res) {
  var gzip = gzipMaybe(req, res)
  pump(req, gzip, res)
}).listen(8080)
```

## API
### `stream = gzipMaybe(req, res)`
Create a transform stream that conditionally compresses the outgoing data.

## License
[MIT](https://tldrlegal.com/license/mit-license)

[0]: https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square
[1]: https://nodejs.org/api/documentation.html#documentation_stability_index
[2]: https://img.shields.io/npm/v/http-gzip-maybe.svg?style=flat-square
[3]: https://npmjs.org/package/http-gzip-maybe
[4]: https://img.shields.io/travis/yoshuawuyts/http-gzip-maybe/master.svg?style=flat-square
[5]: https://travis-ci.org/yoshuawuyts/http-gzip-maybe
[6]: https://img.shields.io/codecov/c/github/yoshuawuyts/http-gzip-maybe/master.svg?style=flat-square
[7]: https://codecov.io/github/yoshuawuyts/http-gzip-maybe
[8]: http://img.shields.io/npm/dm/http-gzip-maybe.svg?style=flat-square
[9]: https://npmjs.org/package/http-gzip-maybe
[10]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[11]: https://github.com/feross/standard

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