# inflation

> Easily unzip an HTTP stream

Latest version **2.1.0** (published 2023-10-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install inflation
pnpm add inflation
yarn add inflation
bun add inflation
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2023-10-14 |
| First published | 2014-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/inflation) |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 19 |
| Author | Jonathan Ong |
| Maintainers | dougwilson, jongleberry, fengmk2 |
| Keywords | decompress, unzip, inflate, zlib, gunzip, brotli |

## Links

- npm: https://www.npmjs.com/package/inflation
- Repository: https://github.com/stream-utils/inflation
- Homepage: https://github.com/stream-utils/inflation#readme
- Issues: https://github.com/stream-utils/inflation/issues
- npm.io page: https://npm.io/package/inflation

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

- 2.1.0 (latest) — 2023-10-14
- 2.0.0 — 2016-04-09
- 1.0.2 — 2014-06-14
- 1.0.1 — 2014-04-24
- 1.0.0 — 2014-04-24

## README

# inflation

[![NPM version](https://badge.fury.io/js/inflation.svg)](http://badge.fury.io/js/inflation)
[![CI](https://github.com/stream-utils/inflation/actions/workflows/nodejs.yml/badge.svg)](https://github.com/stream-utils/inflation/actions/workflows/nodejs.yml)

Automatically unzip an HTTP stream.

## API

```js
var inflate = require('inflation')
```

### inflate(stream, options)

Returns a stream that emits inflated data from the given stream.

Options:

- `encoding` - The encoding of the stream (`gzip` or `deflate`).
  If not given, will look in `stream.headers['content-encoding']`.
- `brotli` - [`BrotliOptions`](https://nodejs.org/api/zlib.html#class-brotlioptions) to use for Brotli decompression

## Example

```js
var inflate = require('inflation')
var raw     = require('raw-body')

http.createServer(function (req, res) {
  raw(inflate(req), 'utf-8', function (err, string) {
    console.dir(string)
  })
})
```

<!-- GITCONTRIBUTOR_START -->

## Contributors

|[<img src="https://avatars.githubusercontent.com/u/67512?v=4" width="100px;"/><br/><sub><b>dougwilson</b></sub>](https://github.com/dougwilson)<br/>|[<img src="https://avatars.githubusercontent.com/u/73755?v=4" width="100px;"/><br/><sub><b>bminer</b></sub>](https://github.com/bminer)<br/>|[<img src="https://avatars.githubusercontent.com/u/156269?v=4" width="100px;"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/>|
| :---: | :---: | :---: |


This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Sat Oct 14 2023 12:55:08 GMT+0800`.

<!-- GITCONTRIBUTOR_END -->

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