Skip to content

denosaurs/deno_brotli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

66 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

deno_brotli

stars workflow releases deno version deno doc Discord license issues

This module provides brotli support for deno and the web by providing simple bindings using rust-brotli compiled to webassembly.

Usage

Compression

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

Decompression

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

Other

Contribution

Pull request, issues and feedback are very welcome. Code style is formatted with deno fmt and commit messages are done following Conventional Commits spec.

Licence

Copyright 2020-2022, the denosaurs team. All rights reserved. MIT license.