CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
1# decompress-response [![Build Status](https://travis-ci.com/sindresorhus/decompress-response.svg?branch=master)](https://travis-ci.com/sindresorhus/decompress-response)2 3> Decompress a HTTP response if needed4 5Decompresses 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, deflated or compressed with Brotli, otherwise just passes it through.6 7Used by [`got`](https://github.com/sindresorhus/got).8 9## Install10 11```12$ npm install decompress-response13```14 15## Usage16 17```js18const http = require('http');19const decompressResponse = require('decompress-response');20 21http.get('https://sindresorhus.com', response => {22	response = decompressResponse(response);23});24```25 26## API27 28### decompressResponse(response)29 30Returns the decompressed HTTP response stream.31 32#### response33 34Type: [`http.IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage)35 36The HTTP incoming stream with compressed data.37 38---39 40<div align="center">41	<b>42		<a href="https://tidelift.com/subscription/pkg/npm-decompress-response?utm_source=npm-decompress-response&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>43	</b>44	<br>45	<sub>46		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.47	</sub>48</div>49