WebAssembly powered Deflate compression for Deno, written in Rust.
deno cache https://deno.land/x/denoflate/mod.ts
import { deflate, inflate } from "https://deno.land/x/denoflate/mod.ts";
const bytes = new Uint8Array([1, 2, 3]);
const compressed = deflate(bytes);
const decompressed = inflate(compressed);
deno run --allow-net https://deno.land/x/denoflate/test.ts
-
Install wasm-pack
cargo install wasm-pack
-
Build
wasm-pack build --target web --release
-
Add
import name from "../mod.ts";
topkg/deflate.js