File: readme.md

package info (click to toggle)
node-decompress-response 3.3.0-1~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 104 kB
  • sloc: makefile: 2; sh: 2
file content (31 lines) | stat: -rw-r--r-- 841 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# decompress-response [![Build Status](https://travis-ci.org/sindresorhus/decompress-response.svg?branch=master)](https://travis-ci.org/sindresorhus/decompress-response)

> Decompress a HTTP response if needed

Decompresses the [response](https://nodejs.org/api/http.html#http_class_http_incomingmessage) from [`http.request`](https://nodejs.org/api/http.html#http_http_request_options_callback) if it's gzipped or deflated, otherwise just passes it through.

Used by [`got`](https://github.com/sindresorhus/got).


## Install

```
$ npm install decompress-response
```


## Usage

```js
const http = require('http');
const decompressResponse = require('decompress-response');

http.get('http://sindresorhus.com', response => {
	response = decompressResponse(response);
});
```


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)