summaryrefslogtreecommitdiff
path: root/bin/wiki/ImportarDesdeURL/node_modules/decompress-response/readme.md
blob: 1b98767f5a1762de47c14e5b9255f41ba8e123c4 (plain)
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)