@jimmy-guzman/decompress-response
v1.0.1
Published
[![version][version-badge]][package] [![downloads][downloads-badge]][npmtrends] [![semantic-release][semantic-release-badge]][semantic-release] [![code style: prettier][prettier-badge]][prettier]
Downloads
1
Readme
@jimmy-guzman/decompress-response
A fork of decompress-response but with CJS support
Decompresses the response from http.request
if it's gzipped, deflated or compressed with Brotli, otherwise just passes it through.
Install
pnpm add @jimmy-guzman/decompress-response
Usage
import http from 'http'
import decompressResponse from '@jimmy-guzman/decompress-response'
http.get('https://sindresorhus.com', (response) => {
response = decompressResponse(response)
})
API
decompressResponse(response)
Returns the decompressed HTTP response stream.
response
Type: http.IncomingMessage
The HTTP incoming stream with compressed data.