Packages

@tootallnate/zstd-wasm

0.1.0 · 16 Jun 2026MIT25.1k / weekRepositoryHomepagenpmAtom feed

Your version

0.1.0

Latest16 Jun 2026Where it was published

In short

1 new

Release note

Minor Changes

  • Add Zstandard compression support alongside the existing decoder.

    The vendored WASM is now built from upstream zstd 1.5.7's full
    single-file library (encoder + decoder) instead of the decoder-only
    amalgamation, still compiled with wasi-sdk and with no WASI imports.
    New exports mirror the existing decode-side shape:

    • ZstdCompressStream — a TransformStream<Uint8Array, Uint8Array>
      subclass mirroring the platform's CompressionStream. Compose with
      plain.pipeThrough(new ZstdCompressStream(wasm, level?)). The
      terminal frame bytes are emitted on stream close, so the output is a
      single complete, decodable zstd frame.

    • ZstdEncoder — lower-level streaming encoder for callers that want
      direct control over chunk feeding (push(chunk, onOutput) then
      finish(onOutput)).

    • compressBytes(wasm, plain, level?) — one-shot helper for buffers
      that comfortably fit in memory.

    • DEFAULT_COMPRESSION_LEVEL (3) — the default zstd level used when
      none is supplied.

    The compression level (1–22) is configurable on ZstdEncoder.create,
    ZstdCompressStream, and compressBytes.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.