Skip to content

Commit 62e8f05

Browse files
authored
chore: modernize module (#3)
1 parent f210932 commit 62e8f05

File tree

11 files changed

+126
-158
lines changed

11 files changed

+126
-158
lines changed

.github/workflows/checks.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ jobs:
1010
uses: actions/checkout@v2
1111

1212
- name: Setup latest deno version
13-
uses: denolib/setup-deno@v2
13+
uses: denoland/setup-deno@v1
1414
with:
1515
deno-version: v1.x
1616

1717
- name: Run deno fmt
1818
run: deno fmt --check
1919

2020
- name: Run deno lint
21-
run: deno lint --unstable
21+
run: deno lint
2222

2323
- name: Run deno test
24-
run: deno test
24+
run: deno task test

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
The format is based on [Keep a Changelog],
6-
and this project adheres to [Semantic Versioning].
5+
The format is based on [Keep a Changelog], and this project adheres to
6+
[Semantic Versioning].
77

88
## [0.1.2] - 2020-08-30
99

Cargo.lock

+35-74
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ crate-type = ["cdylib"]
1313

1414
[dependencies]
1515
lz4-compression = "0.7.0"
16-
wasm-bindgen = "0.2.67"
17-
wee_alloc = { version = "0.4.5", optional = true }
16+
wasm-bindgen = "0.2.88"
1817

1918
[profile.release]
2019
lto = true

README.md

+48-42
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,48 @@
1-
# deno_lz4
2-
3-
[![stars](https://img.shields.io/github/stars/denosaurs/deno_lz4)](https://github.com/denosaurs/deno_lz4/stargazers)
4-
[![workflow](https://img.shields.io/github/workflow/status/denosaurs/deno_lz4/ci)](https://github.com/denosaurs/deno_lz4/actions)
5-
[![releases](https://img.shields.io/github/v/release/denosaurs/deno_lz4)](https://github.com/denosaurs/deno_lz4/releases/latest/)
6-
[![deno version](https://img.shields.io/badge/deno-^1.0.2-informational)](https://github.com/denoland/deno)
7-
[![deno doc](https://img.shields.io/badge/deno-doc-informational)](https://doc.deno.land/https/deno.land/x/deno_lz4/mod.ts)
8-
[![Discord](https://img.shields.io/discord/713043818806509608)](https://discord.gg/shHG8vg)
9-
[![license](https://img.shields.io/github/license/denosaurs/deno_lz4)](https://github.com/denosaurs/deno_lz4/blob/master/LICENSE)
10-
[![issues](https://img.shields.io/github/issues/denosaurs/deno_lz4)](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+
[![stars](https://img.shields.io/github/stars/denosaurs/deno_lz4)](https://github.com/denosaurs/deno_lz4/stargazers)
4+
[![workflow](https://img.shields.io/github/actions/workflow/status/denosaurs/deno_lz4/checks.yml?branch=master)](https://github.com/denosaurs/deno_lz4/actions)
5+
[![releases](https://img.shields.io/github/v/release/denosaurs/deno_lz4)](https://github.com/denosaurs/deno_lz4/releases/latest/)
6+
[![deno version](https://img.shields.io/badge/deno-^1.0.2-informational)](https://github.com/denoland/deno)
7+
[![deno doc](https://img.shields.io/badge/deno-doc-informational)](https://doc.deno.land/https/deno.land/x/deno_lz4/mod.ts)
8+
[![Discord](https://img.shields.io/discord/713043818806509608)](https://discord.gg/shHG8vg)
9+
[![license](https://img.shields.io/github/license/denosaurs/deno_lz4)](https://github.com/denosaurs/deno_lz4/blob/master/LICENSE)
10+
[![issues](https://img.shields.io/github/issues/denosaurs/deno_lz4)](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.

deno.jsonc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"tasks": {
3+
"test": "deno test",
4+
"build": "deno run -A ./scripts/build.ts"
5+
},
6+
"lock": false
7+
}

mod.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
// Copyright 2020-present the denosaurs team. All rights reserved. MIT license.
22

3-
import init, {
4-
source,
5-
lz4_compress,
6-
lz4_decompress,
7-
} from "./wasm.js";
3+
import init, { lz4_compress, lz4_decompress, source } from "./wasm.js";
84

95
await init(source);
106

0 commit comments

Comments
 (0)