Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/denosaurs/deno_brotli
🗜 Brotli wasm module for deno
https://github.com/denosaurs/deno_brotli
brotli compression deno hacktoberfest wasm webassembly
Last synced: about 1 month ago
JSON representation
🗜 Brotli wasm module for deno
- Host: GitHub
- URL: https://github.com/denosaurs/deno_brotli
- Owner: denosaurs
- License: mit
- Created: 2020-05-28T06:17:25.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-20T22:40:36.000Z (about 2 years ago)
- Last Synced: 2024-04-14T00:49:17.679Z (10 months ago)
- Topics: brotli, compression, deno, hacktoberfest, wasm, webassembly
- Language: TypeScript
- Homepage: https://deno.land/x/brotli
- Size: 7.06 MB
- Stars: 63
- Watchers: 4
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# deno_brotli
[](https://github.com/denosaurs/deno_brotli/stargazers)
[](https://github.com/denosaurs/deno_brotli/actions)
[](https://github.com/denosaurs/deno_brotli/releases/latest/)
[](https://github.com/denoland/deno)
[](https://doc.deno.land/https/deno.land/x/deno_brotli/mod.ts)
[](https://discord.gg/shHG8vg)
[](https://github.com/denosaurs/deno_brotli/blob/master/LICENSE)
[](https://github.com/denosaurs/deno_brotli/issues)This module provides [brotli](https://en.wikipedia.org/wiki/Brotli) support for
deno and the web by providing [simple bindings](src/lib.rs) using
[rust-brotli](https://github.com/dropbox/rust-brotli) compiled to webassembly.## Usage
### Compression
```ts
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
```ts
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](https://www.conventionalcommits.org/en/v1.0.0/) spec.### Licence
Copyright 2020-2022, the denosaurs team. All rights reserved. MIT license.