@tootallnate/zstd-wasm
0.1.0 · 16 Jun 2026MIT25.1k / weekRepositoryHomepagenpmAtom feed
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— aTransformStream<Uint8Array, Uint8Array>
subclass mirroring the platform'sCompressionStream. Compose withplain.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)thenfinish(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, andcompressBytes.
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.