@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 CHANGED
@@ -1,20 +1,27 @@
1
- # @hpcc-js/wasm-graphviz
1
+ # @hpcc-js/wasm-zstd
2
2
 
3
- This package provides a WebAssembly wrapper around the [Graphviz](https://www.graphviz.org/) library. This allows for the rendering of DOT language graphs directly within a browser or NodeJS type environment.
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-graphviz
8
+ npm install @hpcc-js/wasm-zstd
9
9
  ```
10
10
 
11
11
  ## Usage
12
12
 
13
13
  ```typescript
14
- import { Graphviz } from "@hpcc-js/wasm-graphviz";
14
+ import { Zstd } from "@hpcc-js/wasm-zstd";
15
15
 
16
- const graphviz = await Graphviz.load();
17
- const svg = graphviz.dot(`digraph { a -> b; }`);
18
- document.body.innerHTML = svg;
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)