Package Exports
- lz4-wasm
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lz4-wasm) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
lz4-wasm
Extremely fast compression/decompression in the browser using wasm.
Built with Rust
🚴 Usage
[📚 Usage! 📚][template-docs]
The wasm module exposes two function compress and decompress. Both accept and return UInt8Array.
import * as wasm from "lz4-wasm";
// use TextEncoder to get bytes (UInt8Array) from string
var enc = new TextEncoder();
const compressed = wasm.compress(enc.encode("compress this text, compress this text pls. thx. thx. thx. thx. thx"));
const original = wasm.decompress(compressed);
var dec = new TextDecoder("utf-8");
alert(dec.decode(original))