@hpcc-js/wasm-zstd 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -7
- package/dist/index.js.map +2 -2
- package/package.json +56 -56
- package/src/zstd.ts +3 -3
- package/types/zstd.d.ts +1 -1
package/README.md
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
# @hpcc-js/wasm-
|
|
1
|
+
# @hpcc-js/wasm-zstd
|
|
2
2
|
|
|
3
|
-
This package provides a WebAssembly wrapper around the [
|
|
3
|
+
This package provides a WebAssembly wrapper around the [Zstandard](https://facebook.github.io/zstd/) library. This provides efficient compression and decompression of data.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npm install @hpcc-js/wasm-
|
|
8
|
+
npm install @hpcc-js/wasm-zstd
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import {
|
|
14
|
+
import { Zstd } from "@hpcc-js/wasm-zstd";
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const zstd = await Zstd.load();
|
|
17
|
+
|
|
18
|
+
// Generate some "data"
|
|
19
|
+
const data = new Uint8Array(Array.from({ length: 100000 }, (_, i) => i % 256));
|
|
20
|
+
|
|
21
|
+
const compressed_data = zstd.compress(data);
|
|
22
|
+
const decompressed_data = zstd.decompress(compressed_data);
|
|
19
23
|
```
|
|
20
24
|
|
|
25
|
+
## Reference
|
|
26
|
+
|
|
27
|
+
* [API Documentation](https://hpcc-systems.github.io/hpcc-js-wasm/zstd/src/zstd/classes/Zstd.html)
|