mts-wasm
v0.1.1
Published
WebAssembly bindings for mts, a Huffman+LZ77 compression library
Downloads
364
Readme
WebAssembly bindings for mts, generated with wasm-bindgen.
Building and smoke-testing locally:
cargo install wasm-pack
rustup target add wasm32-unknown-unknown
cd bindings/wasm
export RUSTFLAGS="--remap-path-prefix=$HOME=~" # keeps your local username/paths out of the compiled binary
wasm-pack build --target nodejs
node smoke-test.mjs--target nodejs produces a CommonJS package in pkg/ that works directly under plain Node (require, or import from ESM/TypeScript via Node's CJS interop) with no bundler needed — the right choice for a TS backend. See ../../PUBLISHING.md for publishing pkg/ to npm.
Exports compress/decompress (bytes in, bytes out) and compressString/decompressToString (string in, string out) for callers who don't want to deal with TextEncoder/TextDecoder themselves.
