decompress-response
Decompress a HTTP response if needed
Last updated 6 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install decompress-response 
SYNC missed versions from official npm registry.

decompress-response

Decompress a HTTP response if needed

Decompresses the response from http.request if it's gzipped, deflated or compressed with Brotli, otherwise just passes it through.

Used by got.

Install

npm install decompress-response

Usage

import http from 'node:http';
import decompressResponse from '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.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Current Tags

  • 8.1.0                                ...           latest (2 years ago)

12 Versions

  • 8.1.0                                ...           2 years ago
  • 8.0.0                                ...           3 years ago
  • 7.0.0                                ...           4 years ago
  • 6.0.0                                ...           4 years ago
  • 5.0.0                                ...           5 years ago
  • 4.2.1                                ...           5 years ago
  • 4.2.0                                ...           6 years ago
  • 4.1.0                                ...           6 years ago
  • 4.0.0                                ...           6 years ago
  • 3.3.0                                ...           7 years ago
  • 3.2.0                                ...           7 years ago
  • 3.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (6)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |