This module provides brotli support for deno and the web by providing simple bindings using rust-brotli compiled to webassembly.
import { compress } from "https://deno.land/x/brotli/mod.ts";
const text = new TextEncoder().encode("X".repeat(64));
console.log(text.length); // 64 Bytes
console.log(compress(text).length); // 10 Bytes
import { decompress } from "https://deno.land/x/brotli/mod.ts";
const compressed = Uint8Array.from([27, 63, 0, 0, 36, 176, 226, 153, 64, 18]);
console.log(compressed.length); // 10 Bytes
console.log(decompress(compressed).length); // 64 Bytes
Pull request, issues and feedback are very welcome. Code style is formatted with
deno fmt
and commit messages are done following
Conventional Commits spec.
Copyright 2020-2022, the denosaurs team. All rights reserved. MIT license.