Back to Explore

sindresorhus/decompress-response

GitHub
1 watchersOpen source

Last release:

Decompress-response is a Node.js utility that automatically decompresses an HTTP response when it is gzipped, deflated, or Brotli-compressed, otherwise it passes the response through unchanged. It returns the decompressed HTTP response stream and is used by the got HTTP client.

Project status

  • The repository appears maintained, with the latest recorded update (v10.0.0) on 2025-10-13, about 10 months before today (2026-08-12).
  • Update cadence looks low and irregular, with major updates spanning roughly every 15 to 16 months (2023-02-23, 2024-05-28, 2025-10-13).

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v10.0.0

    v10.0.0 raises the minimum supported Node.js version to 20. It adds support for decompressing responses encoded with zstd when the running Node.js provides the needed zlib APIs, and includes fixes around stream destruction behavior and empty compressed response handling.

    BreakingFeatures
  • v9.0.0

    v9.0.0 drops support for older Node.js versions (requires Node 18) and fixes an issue where the library could modify the original HTTP response object. The implementation changes how headers are handled during decompression to avoid mutating the input response.

    Breaking
  • v8.1.0

    v8.1.0 adds support for “deflate raw” (RFC1951) responses, not just wrapped deflate (RFC1952) payloads. The release notes are minimal, only mentioning the change and referencing PR #35.

    Features
  • v8.0.0

    v8.0.0 is a major release that moves the package to pure ESM and raises the supported Node.js version. It also includes a fix related to preserving the content-encoding header behavior for uncompressed responses.

    Breaking
  • v7.0.0

    v7.0.0 makes the package delete the `content-encoding` header from HTTP responses and updates the TypeScript typings to reflect that the returned response will no longer have that header. The code also refreshes CI configuration by moving from Travis to a GitHub Actions workflow and updates the README header.

    Breaking
  • v6.0.0

    v6.0.0 is labeled as a major-but-safe Node.js compatibility release. The code changes focus on stream/pipeline handling and error behavior around gzip/deflate/brotli decompression, with a dependency bump for mimic-response.

    Breaking
  • v5.0.0

    v5.0.0 raises the minimum supported Node.js version to 10 and updates the TypeScript declaration to use only CommonJS-style exports. Internally, the decompression logic was refactored to use stream.pipeline for more reliable piping.

    Breaking
  • v4.2.1

    v4.2.1 updates decompress-response to treat the HTTP `content-encoding` header case-insensitively before deciding whether to decompress. The release notes only mention this header handling change.

  • v4.2.0

    v4.2.0 focuses on updating the TypeScript type definitions so the package works more cleanly with CommonJS module consumption. The code change also adds a runtime `default` export interop property, and the test tooling in package.json was switched from `tsd-check` to `tsd`.

    Breaking
  • v4.1.0

    v4.1.0 primarily adds TypeScript support via a new `index.d.ts` definition and introduces TypeScript type tests. The implementation was also adjusted to improve default export interop, and documentation was updated with an API section.

    Features