docs
  1. Changelogs
  2. Storefront Tooling
  3. @scayle/unstorage-compression-driver

@scayle/unstorage-compression-driver

1.5.0

Minor Changes

  • Added optional params field on CompressionDriverOptions, plus a third params argument on the exported compress and decompress functions. The value is passed verbatim as the second argument to Node's zlib.brotliCompress / zlib.brotliDecompress / zlib.gzip / zlib.deflate. Omitting params for non-brotli encodings preserves the previous behaviour byte-for-byte.

    Behavior change for brotli encoding: when params is omitted, the driver now defaults to brotli quality 6 (matches Node's newer zlib.compressBrotli API and is the recommended setting for streaming workloads). The previous default . set indirectly through Node's legacy zlib.brotliCompress API . was quality 11, which targets offline/build-time compression and is ~300x slower to encode for negligible storage benefit on JSON-shaped payloads.
    This is a runtime behavior change but not a contract change: decompression of pre-existing brotli-encoded entries (cached at quality 11) still works . brotli is self-describing on the decoder side, and quality is encode-only. Callers who relied on byte-exact brotli output will see different bytes; pass params: { params: { [BROTLI_PARAM_QUALITY]: 11 } } to restore the prior output.

1.4.1

Patch Changes

  • Migrate build toolchain from unbuild to obuild.

1.4.0

Minor Changes

  • All packages now require Node.js 22 or later, in line with the current Node.js LTS release schedule. See the Node.js release schedule for details.
    If your project is still running an older Node.js version, now is a good time to upgrade to Node.js 22 at minimum, or ideally Node.js 24, for the latest security patches and stability improvements.

1.3.0

Minor Changes

  • Fixed an issue where the compression driver would return undefined when an item was not found. The driver now correctly returns null when the key does not exist, as required by the unstorage driver specification. See: https://unstorage.unjs.io/guide#getitemkey-opts

1.2.5

Patch Changes

  • Updated dependency @opentelemetry/api@^1.9.0 to @opentelemetry/api@catalog:
  • Updated dependency [email protected] to unstorage@catalog:
  • This is an internal change only. The packages now use the PNPM catalog feature to ensure dependencies use the identical version across packages.

1.2.4

Patch Changes

1.2.3

Patch Changes

1.2.2

Patch Changes

  • Cleaned up README.md and added CONTRIBUTING.md. No functional changes.

1.2.1

Patch Changes

1.2.0

Minor Changes

  • Added optional OpenTelemetry tracing around compression and decompression events. To enable this feature, add the buildtime environment variable UNSTORAGE_COMPRESSION_OTEL_TRACE=true.

Patch Changes

  • Added dependency @opentelemetry/api@^1.9.0

1.1.0

Minor Changes

  • Removed destr as dependency and and replaced its usage with JSON.parse for string to object parsing. Depending on the payload size, this should have marginal positive impact on the overall parsing performance. This is an internal refactoring and does not affect usage.

Patch Changes

1.0.2

Patch Changes

1.0.1

Patch Changes

1.0.0

Major Changes

  • Drop CommonJS support. The package is now ESM-only. If you are using this package in a Nuxt 3 context, you should have no issues.

0.2.7

Patch Changes

0.2.6

Patch Changes

0.2.5

Patch Changes

0.2.4

Patch Changes

0.2.3

Patch Changes

0.2.2

Patch Changes

0.2.1

Patch Changes

  • Fix publishing error which caused some files to be missing

0.2.0

Minor Changes

  • Resolved warnings with the types and exports configuration reported by AreTheTypesWronghttps://github.com/arethetypeswrong/arethetypeswrong.github.io. This was done as a preventative measure to protect against potential ESM or TypeScript issues.
    Additionally, we now build the library with unbuild rather than tsc.
    This is essentially an internal refactor and should have no user-visible changes. However, as part of this change, the compression and types export configurations were removed from package.json. The exports were unused, but are mentioned here as it could possibly result in a breaking change.

0.1.5

Patch Changes

0.1.4

Patch Changes

0.1.3

Patch Changes

  • Format code with dprint

0.1.2

Patch Changes

  • Removed unnecessary warning message that indicated that no cache value has been available

0.1.1

Patch Changes

  • Introduce @scayle/unstorage-compression-driver package as custom unstorage driver. It allows to compress values with deflate, gzip or brotli using node:zlib while passing the data source handling to a generic supported driver like redis or Vercel KV.