Home

Awesome

Zstandard WASM

A fast and small port of Zstandard to WASM. (Decompress-only for now).

Features

Install

npm install --save zstandard-wasm

Usage

import fs from 'fs';
import zstd from 'zstandard-wasm'; // Default entrypoint, optimized for speed, ~28kb min+gzip
// import zstd from 'zstandard-wasm/speed'; // Default entrypoint, optimized for speed, ~28kb min+gzip
// import zstd from 'zstandard-wasm/size'; // Alternative entrypoint, optimized for bundle size, ~22kb min+gzip

await zstd.loadWASM (); // First of all you need to load the WASM instance and wait for it

const compressed = fs.readFileSync ( 'something.zst' ); // You get a Buffer or Uint8Array to decompress
const decompressed = zstd.decompress ( compressed ); // You get a Uint8Array containing the decompressed data

Limitations

Licenses