1.0.1 • Published 1 year ago

@jimmy-guzman/decompress-response v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

version downloads semantic-release code style: prettier

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

1.0.1

1 year ago

1.0.0

1 year ago