|
1 |
| -# deno_lz4 |
2 |
| - |
3 |
| -[](https://github.com/denosaurs/deno_lz4/stargazers) |
4 |
| -[](https://github.com/denosaurs/deno_lz4/actions) |
5 |
| -[](https://github.com/denosaurs/deno_lz4/releases/latest/) |
6 |
| -[](https://github.com/denoland/deno) |
7 |
| -[](https://doc.deno.land/https/deno.land/x/deno_lz4/mod.ts) |
8 |
| -[](https://discord.gg/shHG8vg) |
9 |
| -[](https://github.com/denosaurs/deno_lz4/blob/master/LICENSE) |
10 |
| -[](https://github.com/denosaurs/deno_lz4/issues) |
11 |
| - |
12 |
| -This module provides [lz4](https://en.wikipedia.org/wiki/LZ4_(compression_algorithm)) support for deno and the web by providing [simple bindings](src/lib.rs) using [lz4-compression](https://github.com/johannesvollmer/lz4-compression-rs) compiled to webassembly. |
13 |
| - |
14 |
| -## Usage |
15 |
| - |
16 |
| -### Compression |
17 |
| - |
18 |
| -```ts |
19 |
| -import { compress } from "https://deno.land/x/lz4/mod.ts"; |
20 |
| -const text = new TextEncoder().encode("X".repeat(64)); |
21 |
| -console.log(text.length); // 64 Bytes |
22 |
| -console.log(compress(text).length); // 6 Bytes |
23 |
| -``` |
24 |
| - |
25 |
| -### Decompression |
26 |
| - |
27 |
| -```ts |
28 |
| -import { decompress } from "https://deno.land/x/lz4/mod.ts"; |
29 |
| -const compressed = Uint8Array.from([ 31, 88, 1, 0, 44, 0 ]); |
30 |
| -console.log(compressed.length); // 6 Bytes |
31 |
| -console.log(decompress(compressed).length); // 64 Bytes |
32 |
| -``` |
33 |
| - |
34 |
| -## Other |
35 |
| - |
36 |
| -### Contribution |
37 |
| - |
38 |
| -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. |
39 |
| - |
40 |
| -### Licence |
41 |
| - |
42 |
| -Copyright 2020-present, the denosaurs team. All rights reserved. MIT license. |
| 1 | +# deno_lz4 |
| 2 | + |
| 3 | +[](https://github.com/denosaurs/deno_lz4/stargazers) |
| 4 | +[](https://github.com/denosaurs/deno_lz4/actions) |
| 5 | +[](https://github.com/denosaurs/deno_lz4/releases/latest/) |
| 6 | +[](https://github.com/denoland/deno) |
| 7 | +[](https://doc.deno.land/https/deno.land/x/deno_lz4/mod.ts) |
| 8 | +[](https://discord.gg/shHG8vg) |
| 9 | +[](https://github.com/denosaurs/deno_lz4/blob/master/LICENSE) |
| 10 | +[](https://github.com/denosaurs/deno_lz4/issues) |
| 11 | + |
| 12 | +This module provides |
| 13 | +[lz4](https://en.wikipedia.org/wiki/LZ4_(compression_algorithm)) support for |
| 14 | +deno and the web by providing [simple bindings](src/lib.rs) using |
| 15 | +[lz4-compression](https://github.com/johannesvollmer/lz4-compression-rs) |
| 16 | +compiled to webassembly. |
| 17 | + |
| 18 | +## Usage |
| 19 | + |
| 20 | +### Compression |
| 21 | + |
| 22 | +```ts |
| 23 | +import { compress } from "https://deno.land/x/lz4/mod.ts"; |
| 24 | +const text = new TextEncoder().encode("X".repeat(64)); |
| 25 | +console.log(text.length); // 64 Bytes |
| 26 | +console.log(compress(text).length); // 6 Bytes |
| 27 | +``` |
| 28 | + |
| 29 | +### Decompression |
| 30 | + |
| 31 | +```ts |
| 32 | +import { decompress } from "https://deno.land/x/lz4/mod.ts"; |
| 33 | +const compressed = Uint8Array.from([31, 88, 1, 0, 44, 0]); |
| 34 | +console.log(compressed.length); // 6 Bytes |
| 35 | +console.log(decompress(compressed).length); // 64 Bytes |
| 36 | +``` |
| 37 | + |
| 38 | +## Other |
| 39 | + |
| 40 | +### Contribution |
| 41 | + |
| 42 | +Pull request, issues and feedback are very welcome. Code style is formatted with |
| 43 | +`deno fmt` and commit messages are done following |
| 44 | +[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec. |
| 45 | + |
| 46 | +### Licence |
| 47 | + |
| 48 | +Copyright 2020-present, the denosaurs team. All rights reserved. MIT license. |
0 commit comments