• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# unzip-response [![Build Status](https://travis-ci.org/sindresorhus/unzip-response.svg?branch=master)](https://travis-ci.org/sindresorhus/unzip-response)
2
3> Unzip a HTTP response if needed
4
5Unzips the response from [`http.request`](https://nodejs.org/api/http.html#http_http_request_options_callback) if it's gzipped/deflated, otherwise just passes it through.
6
7
8## Install
9
10```
11$ npm install --save unzip-response
12```
13
14
15## Usage
16
17```js
18const http = require('http');
19const unzipResponse = require('unzip-response');
20
21http.get('http://sindresorhus.com', res => {
22	res = unzipResponse(res);
23});
24```
25
26
27## License
28
29MIT © [Sindre Sorhus](https://sindresorhus.com)
30