
@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.