@wasm-zoo/zstd
v0.3.0
Published
Zstandard 1.5.7 compiled for browser WebAssembly by WASM Zoo, with Consumer API v1 and bundled runtime assets.
Maintainers
Readme
@wasm-zoo/zstd
Unofficial WASM Zoo distribution of the original upstream Zstandard 1.5.7 zstd CLI for browsers. This package is backed by Zstandard 1.5.7, Zoo builder 0.3.0, and the reviewed browser-full Release asset.
Install
npm install @wasm-zoo/zstdUse
import { load } from "@wasm-zoo/zstd";
const zstd = await load();
try {
const original = new TextEncoder().encode("WASM Zoo ".repeat(100));
const packed = await zstd.exec(["-q", "-f", "-5", "-o", "/result.zst", "/input.txt"], {
files: [{ name: "/input.txt", data: original }],
outputs: ["/result.zst"]
});
console.log(packed.files[0].data);
} finally {
zstd.dispose();
}The default entry imports the reviewed browser wrapper and uses static new URL(..., import.meta.url) references so modern bundlers can emit zstd-cli.js, zstd-cli.wasm. For manual/self-hosted deployments use @wasm-zoo/zstd/self-hosted and the Consumer API v1 baseUrl contract.
Single-threaded original upstream CLI in an isolated Web Worker with MEMFS. Up to 64 MiB staged input and collected output. No SharedArrayBuffer required. Only browser-full is bundled in npm; browser-core is separately downloadable from the immutable GitHub Release. No native filesystem, pthreads, external codecs or legacy-frame decoding.
