compress-utils 0.9.0 → 0.10.1
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 +114 -80
- package/dist/algorithms/brotli/brotli.wasm +0 -0
- package/dist/algorithms/brotli/compress/brotli.wasm +0 -0
- package/dist/algorithms/brotli/compress/index.d.ts +2 -2
- package/dist/algorithms/brotli/compress/index.d.ts.map +1 -1
- package/dist/algorithms/brotli/decompress/brotli.wasm +0 -0
- package/dist/algorithms/brotli/index.d.ts +2 -2
- package/dist/algorithms/brotli/index.d.ts.map +1 -1
- package/dist/algorithms/bz2/bz2.wasm +0 -0
- package/dist/algorithms/bz2/compress/bz2.wasm +0 -0
- package/dist/algorithms/bz2/compress/index.d.ts +2 -2
- package/dist/algorithms/bz2/compress/index.d.ts.map +1 -1
- package/dist/algorithms/bz2/decompress/bz2.wasm +0 -0
- package/dist/algorithms/bz2/index.d.ts +2 -2
- package/dist/algorithms/bz2/index.d.ts.map +1 -1
- package/dist/algorithms/deflate/compress/index.d.ts +2 -2
- package/dist/algorithms/deflate/compress/index.d.ts.map +1 -1
- package/dist/algorithms/deflate/index.d.ts +2 -2
- package/dist/algorithms/deflate/index.d.ts.map +1 -1
- package/dist/algorithms/gzip/compress/gzip.wasm +0 -0
- package/dist/algorithms/gzip/compress/index.d.ts +2 -2
- package/dist/algorithms/gzip/compress/index.d.ts.map +1 -1
- package/dist/algorithms/gzip/decompress/gzip.wasm +0 -0
- package/dist/algorithms/gzip/gzip.wasm +0 -0
- package/dist/algorithms/gzip/index.d.ts +2 -2
- package/dist/algorithms/gzip/index.d.ts.map +1 -1
- package/dist/algorithms/lz4/compress/index.d.ts +2 -2
- package/dist/algorithms/lz4/compress/index.d.ts.map +1 -1
- package/dist/algorithms/lz4/compress/lz4.wasm +0 -0
- package/dist/algorithms/lz4/decompress/lz4.wasm +0 -0
- package/dist/algorithms/lz4/index.d.ts +2 -2
- package/dist/algorithms/lz4/index.d.ts.map +1 -1
- package/dist/algorithms/lz4/lz4.wasm +0 -0
- package/dist/algorithms/lz4_raw/decompress/index.d.ts +11 -1
- package/dist/algorithms/lz4_raw/decompress/index.d.ts.map +1 -1
- package/dist/algorithms/lz4_raw/decompress/index.js +10 -1
- package/dist/algorithms/lz4_raw/decompress/index.js.map +1 -1
- package/dist/algorithms/lz4_raw/index.d.ts +11 -1
- package/dist/algorithms/lz4_raw/index.d.ts.map +1 -1
- package/dist/algorithms/lz4_raw/index.js +10 -1
- package/dist/algorithms/lz4_raw/index.js.map +1 -1
- package/dist/algorithms/lzo/decompress/index.d.ts +13 -7
- package/dist/algorithms/lzo/decompress/index.d.ts.map +1 -1
- package/dist/algorithms/lzo/decompress/index.js +13 -4
- package/dist/algorithms/lzo/decompress/index.js.map +1 -1
- package/dist/algorithms/lzo/decompress/lzo.wasm +0 -0
- package/dist/algorithms/snappy/compress/index.d.ts +2 -2
- package/dist/algorithms/snappy/compress/index.d.ts.map +1 -1
- package/dist/algorithms/snappy/compress/snappy.wasm +0 -0
- package/dist/algorithms/snappy/decompress/snappy.wasm +0 -0
- package/dist/algorithms/snappy/index.d.ts +2 -2
- package/dist/algorithms/snappy/index.d.ts.map +1 -1
- package/dist/algorithms/snappy/snappy.wasm +0 -0
- package/dist/algorithms/xz/compress/index.d.ts +2 -2
- package/dist/algorithms/xz/compress/index.d.ts.map +1 -1
- package/dist/algorithms/xz/compress/xz.wasm +0 -0
- package/dist/algorithms/xz/decompress/xz.wasm +0 -0
- package/dist/algorithms/xz/index.d.ts +2 -2
- package/dist/algorithms/xz/index.d.ts.map +1 -1
- package/dist/algorithms/xz/xz.wasm +0 -0
- package/dist/algorithms/zlib/compress/index.d.ts +2 -2
- package/dist/algorithms/zlib/compress/index.d.ts.map +1 -1
- package/dist/algorithms/zlib/compress/zlib.wasm +0 -0
- package/dist/algorithms/zlib/decompress/zlib.wasm +0 -0
- package/dist/algorithms/zlib/index.d.ts +2 -2
- package/dist/algorithms/zlib/index.d.ts.map +1 -1
- package/dist/algorithms/zlib/zlib.wasm +0 -0
- package/dist/algorithms/zstd/compress/index.d.ts +2 -2
- package/dist/algorithms/zstd/compress/index.d.ts.map +1 -1
- package/dist/algorithms/zstd/compress/zstd.wasm +0 -0
- package/dist/algorithms/zstd/decompress/zstd.wasm +0 -0
- package/dist/algorithms/zstd/index.d.ts +2 -2
- package/dist/algorithms/zstd/index.d.ts.map +1 -1
- package/dist/algorithms/zstd/zstd.wasm +0 -0
- package/dist/core/capacity.d.ts +1 -1
- package/dist/core/capacity.d.ts.map +1 -1
- package/dist/core/capacity.js +5 -6
- package/dist/core/capacity.js.map +1 -1
- package/dist/core/dispatch.d.ts +15 -4
- package/dist/core/dispatch.d.ts.map +1 -1
- package/dist/core/dispatch.js +22 -1
- package/dist/core/dispatch.js.map +1 -1
- package/dist/core/loader.d.ts +1 -0
- package/dist/core/loader.d.ts.map +1 -1
- package/dist/core/loader.js.map +1 -1
- package/dist/core/types.d.ts +9 -0
- package/dist/core/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/compress-utils)
|
|
4
4
|
[](https://www.npmjs.com/package/compress-utils)
|
|
5
5
|
[](https://www.npmjs.com/package/compress-utils)
|
|
6
|
+
[](https://github.com/dupontcyborg/compress-utils/actions/workflows/build_and_test_wasm.yml)
|
|
6
7
|
[](https://opensource.org/licenses/MIT)
|
|
7
8
|
|
|
8
|
-
Unified WebAssembly bindings for eight compression algorithms
|
|
9
|
+
Unified WebAssembly bindings for eight compression algorithms — Zstandard, Brotli, zlib, gzip, bzip2, LZ4, XZ/LZMA, and Snappy — over a single high-performance C core. Same API for every algorithm, in every JavaScript runtime, with tree-shakeable imports so bundlers ship only what you use.
|
|
9
10
|
|
|
10
11
|
## Installation
|
|
11
12
|
|
|
@@ -16,39 +17,38 @@ npm install compress-utils
|
|
|
16
17
|
|
|
17
18
|
### CDN (no bundler)
|
|
18
19
|
|
|
19
|
-
The package is published as ESM. You can pull it straight from a CDN
|
|
20
|
+
The package is published as ESM. You can pull it straight from a CDN, with no install step and no build step.
|
|
20
21
|
|
|
21
22
|
```html
|
|
22
23
|
<script type="module">
|
|
23
|
-
|
|
24
|
-
"https://esm.sh/compress-utils/zstd";
|
|
24
|
+
import { compress, decompress } from "https://esm.sh/compress-utils/zstd";
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
new TextEncoder().encode("hello")
|
|
28
|
-
);
|
|
26
|
+
const out = await compress(new TextEncoder().encode("hello"));
|
|
29
27
|
</script>
|
|
30
28
|
```
|
|
31
29
|
|
|
32
|
-
| CDN
|
|
33
|
-
|
|
34
|
-
| esm.sh
|
|
35
|
-
| jsDelivr
|
|
36
|
-
| unpkg
|
|
30
|
+
| CDN | Per-algo URL |
|
|
31
|
+
|----------|-------------------------------------------------------------------------------|
|
|
32
|
+
| esm.sh | `https://esm.sh/compress-utils/<algo>` |
|
|
33
|
+
| jsDelivr | `https://cdn.jsdelivr.net/npm/compress-utils/dist/algorithms/<algo>/index.js` |
|
|
34
|
+
| unpkg | `https://unpkg.com/compress-utils/dist/algorithms/<algo>/index.js` |
|
|
37
35
|
|
|
38
36
|
## Quick start
|
|
39
37
|
|
|
40
|
-
Each algorithm is its own subpath import. Pick the one you need
|
|
38
|
+
Each algorithm is its own subpath import. Pick the one you need, and the rest stay out of your bundle.
|
|
41
39
|
|
|
42
40
|
```ts
|
|
43
41
|
import { compress, decompress } from "compress-utils/zstd";
|
|
44
42
|
|
|
45
|
-
const input = new TextEncoder().encode("the quick brown fox "
|
|
43
|
+
const input = new TextEncoder().encode("the quick brown fox ".repeat(50));
|
|
46
44
|
|
|
47
45
|
const compressed = await compress(input, { level: 9 });
|
|
48
46
|
const restored = await decompress(compressed);
|
|
49
47
|
```
|
|
50
48
|
|
|
51
|
-
Available subpaths: `compress-utils/zstd`, `/brotli`, `/zlib`, `/bz2`, `/lz4`, `/xz`, `/snappy`, `/gzip`.
|
|
49
|
+
Available subpaths: `compress-utils/zstd`, `/brotli`, `/zlib`, `/bz2`, `/lz4`, `/xz`, `/snappy`, `/gzip`, plus the raw block formats `/deflate`, `/lz4_raw` and `/lzo/decompress`. The surface is identical across all of them. Each also has `/<algo>/decompress` and `/<algo>/compress` variants that ship only one direction for a much smaller `.wasm`; see [Bundle size](#bundle-size).
|
|
50
|
+
|
|
51
|
+
## Streaming
|
|
52
52
|
|
|
53
53
|
### Web Streams
|
|
54
54
|
|
|
@@ -72,91 +72,70 @@ chunks.push(cs.finish());
|
|
|
72
72
|
// cs is destroyed automatically on scope exit (TS 5.2+ / Node 22+).
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
If `using` isn't available in your toolchain, call `cs.destroy()` explicitly
|
|
75
|
+
If `using` isn't available in your toolchain, call `cs.destroy()` explicitly, or rely on the GC backstop: a `FinalizationRegistry` frees the C-side handle eventually.
|
|
76
76
|
|
|
77
77
|
## Supported algorithms
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
| zlib | `compress-utils/zlib` | zlib wrapper (RFC 1950) |
|
|
82
|
-
| bzip2 | `compress-utils/bz2` | bzip2 stream |
|
|
83
|
-
| XZ/LZMA | `compress-utils/xz` | XZ stream with CRC64 |
|
|
84
|
-
| LZ4 | `compress-utils/lz4` | LZ4 frame (compatible with `.lz4` files) |
|
|
85
|
-
| Zstandard | `compress-utils/zstd` | ZSTD frame with content size |
|
|
86
|
-
| Brotli | `compress-utils/brotli` | raw Brotli stream |
|
|
87
|
-
| Snappy | `compress-utils/snappy` | Raw Snappy block |
|
|
88
|
-
| gzip | `compress-utils/gzip` | gzip stream (RFC 1952) |
|
|
89
|
-
| LZO | `compress-utils/lzo/decompress` | Raw LZO1X block (decompress only; pass `{expectedSize}` as output capacity) |
|
|
79
|
+
<!-- BEGIN:algorithms -->
|
|
80
|
+
<!-- Generated by tools/check-readmes.py from docs/readme/manifest.json. Edit the manifest and run `tools/check-readmes.py --fix`, not this block. -->
|
|
90
81
|
|
|
91
|
-
|
|
82
|
+
| Algorithm | Subpath | Wire format |
|
|
83
|
+
|-----------|---------------------------------|------------------------------------------------------------------------------------------|
|
|
84
|
+
| Zstandard | `compress-utils/zstd` | ZSTD frame with content size |
|
|
85
|
+
| Brotli | `compress-utils/brotli` | Raw Brotli stream |
|
|
86
|
+
| zlib | `compress-utils/zlib` | zlib wrapper (RFC 1950) |
|
|
87
|
+
| gzip | `compress-utils/gzip` | gzip stream (RFC 1952) |
|
|
88
|
+
| bzip2 | `compress-utils/bz2` | bzip2 stream |
|
|
89
|
+
| LZ4 | `compress-utils/lz4` | LZ4 frame (interoperable with the `lz4` CLI and `.lz4` files) |
|
|
90
|
+
| XZ / LZMA | `compress-utils/xz` | XZ stream with CRC64 |
|
|
91
|
+
| Snappy | `compress-utils/snappy` | Raw Snappy block (interoperable with reference snappy and python-snappy) |
|
|
92
|
+
| DEFLATE | `compress-utils/deflate` | Raw DEFLATE (RFC 1951), no wrapper |
|
|
93
|
+
| LZ4 block | `compress-utils/lz4_raw` | Raw LZ4 block, no frame or size prefix (one-shot compression, incremental decompression) |
|
|
94
|
+
| LZO1X | `compress-utils/lzo/decompress` | Raw LZO1X block (decompression only) |
|
|
95
|
+
<!-- END:algorithms -->
|
|
92
96
|
|
|
93
|
-
|
|
97
|
+
Imports are independent: `import "compress-utils/zstd"` and `import "compress-utils/brotli"` pull in two separate `.wasm` modules, not a combined bundle. Files are marked `"sideEffects": false` so unused exports are tree-shaken aggressively. For per-module `.wasm` sizes, and the smaller decode-only and encode-only builds, see [Bundle size](#bundle-size).
|
|
98
|
+
|
|
99
|
+
### Raw blocks and output capacity
|
|
94
100
|
|
|
95
|
-
|
|
101
|
+
Raw block formats such as those inside Parquet and ORC pages don't record their decompressed size. Pass `expectedSize`, an upper bound on the output, and the result holds only the bytes actually decoded:
|
|
96
102
|
|
|
97
103
|
```ts
|
|
98
|
-
|
|
99
|
-
import { decompress } from "compress-utils/zstd/decompress";
|
|
104
|
+
import { decompress } from "compress-utils/lz4_raw";
|
|
100
105
|
|
|
101
|
-
|
|
102
|
-
import { compress } from "compress-utils/zstd/compress";
|
|
106
|
+
const page = await decompress(block, { expectedSize: uncompressedPageSize });
|
|
103
107
|
```
|
|
104
108
|
|
|
105
|
-
|
|
106
|
-
- **`/compress`** exposes `compress`, `createCompressStream`, `compressionStream`, `version`.
|
|
107
|
-
- The default subpath keeps **both**
|
|
108
|
-
|
|
109
|
-
Comparison of the gzipped sizes:
|
|
110
|
-
|
|
111
|
-
| algo | full | decompress-only | compress-only |
|
|
112
|
-
|--------|--------------:|----------------------:|----------------------:|
|
|
113
|
-
| zstd | 128K | 36K | 106K |
|
|
114
|
-
| brotli | 169K | 84K | 154K |
|
|
115
|
-
| lz4 | 39K | 15K | 35K |
|
|
116
|
-
| bz2 | 33K | 22K | 25K |
|
|
117
|
-
| xz | 62K | 43K | 51K |
|
|
118
|
-
| zlib | 33K | 25K | 26K |
|
|
119
|
-
| snappy | 36K | 32K | 28K |
|
|
120
|
-
| gzip | 80K | 52K | 60K |
|
|
121
|
-
|
|
122
|
-
The `.wasm` is the bulk of what ships; the JS glue is a few KB, shared, and tree-shaken to the methods you import.
|
|
109
|
+
Without `expectedSize`, `lz4_raw` blocks are decoded with the incremental stream decoder, which is much slower, so pass it when you know the size. Every other algorithm accepts it too, which skips a sizing pass and decodes straight into a buffer of that size.
|
|
123
110
|
|
|
124
111
|
## Compression levels
|
|
125
112
|
|
|
126
|
-
Every algorithm accepts a `level` from **1 (fastest) to 10 (smallest)**. The binding maps that to each algorithm's native range internally
|
|
113
|
+
Every algorithm accepts a `level` from **1 (fastest) to 10 (smallest)**. The binding maps that to each algorithm's native range internally, so you don't need to know that Zstandard goes 1–22 and zlib goes 1–9. The default is `5`.
|
|
127
114
|
|
|
128
115
|
```ts
|
|
129
116
|
await compress(input, { level: 1 }); // fastest
|
|
130
117
|
await compress(input, { level: 10 }); // smallest
|
|
131
118
|
```
|
|
132
119
|
|
|
133
|
-
##
|
|
134
|
-
|
|
135
|
-
Tested in CI on every release:
|
|
136
|
-
|
|
137
|
-
| Runtime | Status |
|
|
138
|
-
|----------------------|--------|
|
|
139
|
-
| Node 20, 22, 24 | ✅ |
|
|
140
|
-
| Bun | ✅ |
|
|
141
|
-
| Deno 2.x | ✅ |
|
|
142
|
-
| Chromium / Firefox / WebKit (Playwright) | ✅ |
|
|
143
|
-
|
|
144
|
-
## TypeScript
|
|
120
|
+
## Errors and limits
|
|
145
121
|
|
|
146
|
-
|
|
122
|
+
Every failure throws a `CompressError`, which carries the underlying C status code and the algorithm name:
|
|
147
123
|
|
|
148
124
|
```ts
|
|
149
|
-
import { compress,
|
|
125
|
+
import { compress, decompress, CompressError } from "compress-utils/zstd";
|
|
150
126
|
|
|
151
|
-
|
|
152
|
-
|
|
127
|
+
try {
|
|
128
|
+
await decompress(garbage);
|
|
129
|
+
} catch (e) {
|
|
130
|
+
if (e instanceof CompressError) console.error(e.algorithm, e.code, e.message);
|
|
131
|
+
}
|
|
153
132
|
```
|
|
154
133
|
|
|
134
|
+
`await version()` returns the library version (for example `"0.9.0"`), and `await setMaxDecompressedSize(bytes)` bounds one-shot decompression (default 1 GiB; `0` = unbounded). Both are exported from every subpath that includes decompression.
|
|
135
|
+
|
|
155
136
|
## Preloading and synchronous calls
|
|
156
137
|
|
|
157
|
-
Each algorithm and direction-specific subpath exports `preload()`. It loads and
|
|
158
|
-
initializes that subpath's WASM module once; concurrent calls share initialization.
|
|
159
|
-
A failed initialization can be retried. No codec work is performed by preload.
|
|
138
|
+
Each algorithm and direction-specific subpath exports `preload()`. It loads and initializes that subpath's WASM module once, and concurrent calls share initialization. A failed initialization can be retried. No codec work is performed by preload.
|
|
160
139
|
|
|
161
140
|
```ts
|
|
162
141
|
import { preload, compressSync, decompressSync } from "compress-utils/zlib";
|
|
@@ -165,13 +144,68 @@ const compressed = compressSync(new TextEncoder().encode("hello"));
|
|
|
165
144
|
const restored = decompressSync(compressed);
|
|
166
145
|
```
|
|
167
146
|
|
|
168
|
-
`compressSync`, `decompressSync`, `createCompressStreamSync`, and
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
147
|
+
`compressSync`, `decompressSync`, `createCompressStreamSync`, and `createDecompressStreamSync` are available for the directions exposed by the subpath. They throw with a `preload()` instruction before initialization completes. Existing asynchronous APIs initialize automatically and also enable subsequent synchronous calls. Initializing one subpath does not initialize another, because encoder and decoder subpaths use different WASM modules.
|
|
148
|
+
|
|
149
|
+
## Concurrency
|
|
150
|
+
|
|
151
|
+
Each WASM module instance runs on the thread that loaded it, so nothing is shared between workers: every Worker initializes its own instance and keeps its own streams. Synchronous calls block the calling thread, so run expensive ones in a Worker. A stream handle holds state inside its module instance, so feed each stream from one logical flow rather than from interleaved callers.
|
|
152
|
+
|
|
153
|
+
## Bundle size
|
|
154
|
+
|
|
155
|
+
Importing `compress-utils/<algo>` gives you the **full** codec, compress *and* decompress. If you only need one direction (a browser that just *decompresses* fetched assets is the common case), import a directional subpath and the other half is dead-stripped from the `.wasm` entirely:
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
// decoder only, 36 KB gzipped for zstd
|
|
159
|
+
import { decompress } from "compress-utils/zstd/decompress";
|
|
160
|
+
|
|
161
|
+
// or, encoder only:
|
|
162
|
+
import { compress } from "compress-utils/zstd/compress";
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
- **`/decompress`** exposes `decompress`, `createDecompressStream`, `decompressionStream`, `setMaxDecompressedSize` and `version`.
|
|
166
|
+
- **`/compress`** exposes `compress`, `createCompressStream`, `compressionStream` and `version`.
|
|
167
|
+
- The default subpath keeps **both**.
|
|
168
|
+
|
|
169
|
+
Gzipped `.wasm` sizes:
|
|
170
|
+
|
|
171
|
+
| algo | full | decompress-only | compress-only |
|
|
172
|
+
|--------|-----:|----------------:|--------------:|
|
|
173
|
+
| zstd | 128K | 36K | 106K |
|
|
174
|
+
| brotli | 169K | 84K | 154K |
|
|
175
|
+
| lz4 | 39K | 15K | 35K |
|
|
176
|
+
| bz2 | 33K | 22K | 25K |
|
|
177
|
+
| xz | 62K | 43K | 51K |
|
|
178
|
+
| zlib | 33K | 25K | 26K |
|
|
179
|
+
| snappy | 36K | 32K | 28K |
|
|
180
|
+
| gzip | 80K | 52K | 60K |
|
|
181
|
+
|
|
182
|
+
The `.wasm` is the bulk of what ships. The JS glue is a few KB, shared, and tree-shaken to the methods you import.
|
|
183
|
+
|
|
184
|
+
## Runtime support
|
|
185
|
+
|
|
186
|
+
Tested in CI on every release:
|
|
187
|
+
|
|
188
|
+
| Runtime | Status |
|
|
189
|
+
|------------------------------------------|--------|
|
|
190
|
+
| Node 20, 22, 24 | ✅ |
|
|
191
|
+
| Bun | ✅ |
|
|
192
|
+
| Deno 2.x | ✅ |
|
|
193
|
+
| Chromium / Firefox / WebKit (Playwright) | ✅ |
|
|
194
|
+
|
|
195
|
+
## TypeScript
|
|
196
|
+
|
|
197
|
+
The package is TypeScript-first. `.d.ts` files ship alongside the JS for every subpath, so no `@types/` package is needed.
|
|
198
|
+
|
|
199
|
+
```ts
|
|
200
|
+
import { compress, type CompressOptions, type CompressError } from "compress-utils/zstd";
|
|
201
|
+
|
|
202
|
+
const opts: CompressOptions = { level: 7 };
|
|
203
|
+
const compressed: Uint8Array = await compress(input, opts);
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Performance
|
|
207
|
+
|
|
208
|
+
Overhead versus native C is **0.60–0.84× on compress and 0.50–1.00× on decompress**. WASM is the slowest binding across the board: zstd and brotli decode are the worst cases because they lean on native SIMD, while lz4 decode is memory-bound and costs nothing extra in the sandbox. The reasons to choose this binding are portability, one API in every runtime, and the small per-codec bundles above, rather than beating native `node:zlib`. Compression ratio is byte-identical to every other binding. See the [language comparison](https://github.com/dupontcyborg/compress-utils/blob/main/benchmarks/README.md#language-comparison) for methodology and the full chart.
|
|
175
209
|
|
|
176
210
|
## License
|
|
177
211
|
|
|
@@ -179,4 +213,4 @@ MIT. See [LICENSE](https://github.com/dupontcyborg/compress-utils/blob/main/LICE
|
|
|
179
213
|
|
|
180
214
|
---
|
|
181
215
|
|
|
182
|
-
Built by [Nico Dupont](https://nico.codes).
|
|
216
|
+
Part of [compress-utils](https://github.com/dupontcyborg/compress-utils). Built by [Nico Dupont](https://nico.codes).
|
|
Binary file
|
|
Binary file
|
|
@@ -4,11 +4,11 @@ export declare const compressSync: (input: Uint8Array, opts?: import("./index.js
|
|
|
4
4
|
export declare const createCompressStream: (opts?: import("./index.js").CompressOptions) => Promise<import("./index.js").CompressStream>;
|
|
5
5
|
/** Synchronous counterpart; requires completed preload(). */
|
|
6
6
|
export declare const createCompressStreamSync: (opts?: import("./index.js").CompressOptions) => import("./index.js").CompressStream;
|
|
7
|
-
export declare const compressionStream: (opts?: import("./index.js").
|
|
7
|
+
export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
|
|
8
8
|
/** Initializes this independently loaded WASM subpath. */
|
|
9
9
|
export declare const preload: () => Promise<void>;
|
|
10
10
|
export declare const version: () => Promise<string>;
|
|
11
11
|
export { CompressError } from "../../../core/types.js";
|
|
12
|
-
export type { CompressOptions, AlgorithmName } from "../../../core/types.js";
|
|
12
|
+
export type { CompressOptions, CompressionStreamOptions, AlgorithmName, } from "../../../core/types.js";
|
|
13
13
|
export type { CompressStream } from "../../../core/dispatch.js";
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/brotli/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/brotli/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,aAAa,GAChB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
|
Binary file
|
|
@@ -10,13 +10,13 @@ export declare const createCompressStreamSync: (opts?: import("./index.js").Comp
|
|
|
10
10
|
export declare const createDecompressStream: () => Promise<import("./index.js").DecompressStream>;
|
|
11
11
|
/** Synchronous counterpart; requires completed preload(). */
|
|
12
12
|
export declare const createDecompressStreamSync: () => import("./index.js").DecompressStream;
|
|
13
|
-
export declare const compressionStream: (opts?: import("./index.js").
|
|
13
|
+
export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
|
|
14
14
|
export declare const decompressionStream: () => TransformStream<Uint8Array, Uint8Array>;
|
|
15
15
|
/** Initializes this independently loaded WASM subpath. */
|
|
16
16
|
export declare const preload: () => Promise<void>;
|
|
17
17
|
export declare const version: () => Promise<string>;
|
|
18
18
|
export declare const setMaxDecompressedSize: (bytes: number) => Promise<void>;
|
|
19
19
|
export { CompressError } from "../../core/types.js";
|
|
20
|
-
export type { CompressOptions, DecompressOptions, AlgorithmName } from "../../core/types.js";
|
|
20
|
+
export type { CompressOptions, CompressionStreamOptions, DecompressOptions, AlgorithmName, } from "../../core/types.js";
|
|
21
21
|
export type { CompressStream, DecompressStream } from "../../core/dispatch.js";
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/brotli/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,cAAc,kFAA0B,CAAC;AACtD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6DAA6D;AAC7D,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/brotli/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,cAAc,kFAA0B,CAAC;AACtD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6DAA6D;AAC7D,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,eAAO,MAAM,mBAAmB,+CAA+B,CAAC;AAChE,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AACxC,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,GAChB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
Binary file
|
|
Binary file
|
|
@@ -4,11 +4,11 @@ export declare const compressSync: (input: Uint8Array, opts?: import("./index.js
|
|
|
4
4
|
export declare const createCompressStream: (opts?: import("./index.js").CompressOptions) => Promise<import("./index.js").CompressStream>;
|
|
5
5
|
/** Synchronous counterpart; requires completed preload(). */
|
|
6
6
|
export declare const createCompressStreamSync: (opts?: import("./index.js").CompressOptions) => import("./index.js").CompressStream;
|
|
7
|
-
export declare const compressionStream: (opts?: import("./index.js").
|
|
7
|
+
export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
|
|
8
8
|
/** Initializes this independently loaded WASM subpath. */
|
|
9
9
|
export declare const preload: () => Promise<void>;
|
|
10
10
|
export declare const version: () => Promise<string>;
|
|
11
11
|
export { CompressError } from "../../../core/types.js";
|
|
12
|
-
export type { CompressOptions, AlgorithmName } from "../../../core/types.js";
|
|
12
|
+
export type { CompressOptions, CompressionStreamOptions, AlgorithmName, } from "../../../core/types.js";
|
|
13
13
|
export type { CompressStream } from "../../../core/dispatch.js";
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/bz2/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/bz2/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,aAAa,GAChB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
|
Binary file
|
|
@@ -10,13 +10,13 @@ export declare const createCompressStreamSync: (opts?: import("./index.js").Comp
|
|
|
10
10
|
export declare const createDecompressStream: () => Promise<import("./index.js").DecompressStream>;
|
|
11
11
|
/** Synchronous counterpart; requires completed preload(). */
|
|
12
12
|
export declare const createDecompressStreamSync: () => import("./index.js").DecompressStream;
|
|
13
|
-
export declare const compressionStream: (opts?: import("./index.js").
|
|
13
|
+
export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
|
|
14
14
|
export declare const decompressionStream: () => TransformStream<Uint8Array, Uint8Array>;
|
|
15
15
|
/** Initializes this independently loaded WASM subpath. */
|
|
16
16
|
export declare const preload: () => Promise<void>;
|
|
17
17
|
export declare const version: () => Promise<string>;
|
|
18
18
|
export declare const setMaxDecompressedSize: (bytes: number) => Promise<void>;
|
|
19
19
|
export { CompressError } from "../../core/types.js";
|
|
20
|
-
export type { CompressOptions, DecompressOptions, AlgorithmName } from "../../core/types.js";
|
|
20
|
+
export type { CompressOptions, CompressionStreamOptions, DecompressOptions, AlgorithmName, } from "../../core/types.js";
|
|
21
21
|
export type { CompressStream, DecompressStream } from "../../core/dispatch.js";
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/bz2/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,cAAc,kFAA0B,CAAC;AACtD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6DAA6D;AAC7D,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/bz2/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,cAAc,kFAA0B,CAAC;AACtD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6DAA6D;AAC7D,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,eAAO,MAAM,mBAAmB,+CAA+B,CAAC;AAChE,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AACxC,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,GAChB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -2,10 +2,10 @@ export declare const compress: (input: Uint8Array, opts?: import("./index.js").C
|
|
|
2
2
|
export declare const compressSync: (input: Uint8Array, opts?: import("./index.js").CompressOptions) => Uint8Array;
|
|
3
3
|
export declare const createCompressStream: (opts?: import("./index.js").CompressOptions) => Promise<import("./index.js").CompressStream>;
|
|
4
4
|
export declare const createCompressStreamSync: (opts?: import("./index.js").CompressOptions) => import("./index.js").CompressStream;
|
|
5
|
-
export declare const compressionStream: (opts?: import("./index.js").
|
|
5
|
+
export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
|
|
6
6
|
export declare const preload: () => Promise<void>;
|
|
7
7
|
export declare const version: () => Promise<string>;
|
|
8
8
|
export { CompressError } from "../../../core/types.js";
|
|
9
|
-
export type { CompressOptions, AlgorithmName } from "../../../core/types.js";
|
|
9
|
+
export type { CompressOptions, CompressionStreamOptions, AlgorithmName, } from "../../../core/types.js";
|
|
10
10
|
export type { CompressStream } from "../../../core/dispatch.js";
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/deflate/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/deflate/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,aAAa,GAChB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -6,12 +6,12 @@ export declare const createCompressStream: (opts?: import("./index.js").Compress
|
|
|
6
6
|
export declare const createCompressStreamSync: (opts?: import("./index.js").CompressOptions) => import("./index.js").CompressStream;
|
|
7
7
|
export declare const createDecompressStream: () => Promise<import("./index.js").DecompressStream>;
|
|
8
8
|
export declare const createDecompressStreamSync: () => import("./index.js").DecompressStream;
|
|
9
|
-
export declare const compressionStream: (opts?: import("./index.js").
|
|
9
|
+
export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
|
|
10
10
|
export declare const decompressionStream: () => TransformStream<Uint8Array, Uint8Array>;
|
|
11
11
|
export declare const preload: () => Promise<void>;
|
|
12
12
|
export declare const version: () => Promise<string>;
|
|
13
13
|
export declare const setMaxDecompressedSize: (bytes: number) => Promise<void>;
|
|
14
14
|
export { CompressError } from "../../core/types.js";
|
|
15
|
-
export type { CompressOptions, DecompressOptions, AlgorithmName } from "../../core/types.js";
|
|
15
|
+
export type { CompressOptions, CompressionStreamOptions, DecompressOptions, AlgorithmName, } from "../../core/types.js";
|
|
16
16
|
export type { CompressStream, DecompressStream } from "../../core/dispatch.js";
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/deflate/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,eAAO,MAAM,cAAc,kFAA0B,CAAC;AACtD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/deflate/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,eAAO,MAAM,cAAc,kFAA0B,CAAC;AACtD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,eAAO,MAAM,mBAAmB,+CAA+B,CAAC;AAChE,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AACxC,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,GAChB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
Binary file
|
|
@@ -4,11 +4,11 @@ export declare const compressSync: (input: Uint8Array, opts?: import("./index.js
|
|
|
4
4
|
export declare const createCompressStream: (opts?: import("./index.js").CompressOptions) => Promise<import("./index.js").CompressStream>;
|
|
5
5
|
/** Synchronous counterpart; requires completed preload(). */
|
|
6
6
|
export declare const createCompressStreamSync: (opts?: import("./index.js").CompressOptions) => import("./index.js").CompressStream;
|
|
7
|
-
export declare const compressionStream: (opts?: import("./index.js").
|
|
7
|
+
export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
|
|
8
8
|
/** Initializes this independently loaded WASM subpath. */
|
|
9
9
|
export declare const preload: () => Promise<void>;
|
|
10
10
|
export declare const version: () => Promise<string>;
|
|
11
11
|
export { CompressError } from "../../../core/types.js";
|
|
12
|
-
export type { CompressOptions, AlgorithmName } from "../../../core/types.js";
|
|
12
|
+
export type { CompressOptions, CompressionStreamOptions, AlgorithmName, } from "../../../core/types.js";
|
|
13
13
|
export type { CompressStream } from "../../../core/dispatch.js";
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/gzip/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/gzip/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,aAAa,GAChB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
|
Binary file
|
|
Binary file
|
|
@@ -10,13 +10,13 @@ export declare const createCompressStreamSync: (opts?: import("./index.js").Comp
|
|
|
10
10
|
export declare const createDecompressStream: () => Promise<import("./index.js").DecompressStream>;
|
|
11
11
|
/** Synchronous counterpart; requires completed preload(). */
|
|
12
12
|
export declare const createDecompressStreamSync: () => import("./index.js").DecompressStream;
|
|
13
|
-
export declare const compressionStream: (opts?: import("./index.js").
|
|
13
|
+
export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
|
|
14
14
|
export declare const decompressionStream: () => TransformStream<Uint8Array, Uint8Array>;
|
|
15
15
|
/** Initializes this independently loaded WASM subpath. */
|
|
16
16
|
export declare const preload: () => Promise<void>;
|
|
17
17
|
export declare const version: () => Promise<string>;
|
|
18
18
|
export declare const setMaxDecompressedSize: (bytes: number) => Promise<void>;
|
|
19
19
|
export { CompressError } from "../../core/types.js";
|
|
20
|
-
export type { CompressOptions, DecompressOptions, AlgorithmName } from "../../core/types.js";
|
|
20
|
+
export type { CompressOptions, CompressionStreamOptions, DecompressOptions, AlgorithmName, } from "../../core/types.js";
|
|
21
21
|
export type { CompressStream, DecompressStream } from "../../core/dispatch.js";
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/gzip/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,cAAc,kFAA0B,CAAC;AACtD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6DAA6D;AAC7D,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/gzip/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,cAAc,kFAA0B,CAAC;AACtD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6DAA6D;AAC7D,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,eAAO,MAAM,mBAAmB,+CAA+B,CAAC;AAChE,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AACxC,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,GAChB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -4,11 +4,11 @@ export declare const compressSync: (input: Uint8Array, opts?: import("./index.js
|
|
|
4
4
|
export declare const createCompressStream: (opts?: import("./index.js").CompressOptions) => Promise<import("./index.js").CompressStream>;
|
|
5
5
|
/** Synchronous counterpart; requires completed preload(). */
|
|
6
6
|
export declare const createCompressStreamSync: (opts?: import("./index.js").CompressOptions) => import("./index.js").CompressStream;
|
|
7
|
-
export declare const compressionStream: (opts?: import("./index.js").
|
|
7
|
+
export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
|
|
8
8
|
/** Initializes this independently loaded WASM subpath. */
|
|
9
9
|
export declare const preload: () => Promise<void>;
|
|
10
10
|
export declare const version: () => Promise<string>;
|
|
11
11
|
export { CompressError } from "../../../core/types.js";
|
|
12
|
-
export type { CompressOptions, AlgorithmName } from "../../../core/types.js";
|
|
12
|
+
export type { CompressOptions, CompressionStreamOptions, AlgorithmName, } from "../../../core/types.js";
|
|
13
13
|
export type { CompressStream } from "../../../core/dispatch.js";
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/lz4/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/lz4/compress/index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AAExC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,aAAa,GAChB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
|
Binary file
|
|
Binary file
|
|
@@ -10,13 +10,13 @@ export declare const createCompressStreamSync: (opts?: import("./index.js").Comp
|
|
|
10
10
|
export declare const createDecompressStream: () => Promise<import("./index.js").DecompressStream>;
|
|
11
11
|
/** Synchronous counterpart; requires completed preload(). */
|
|
12
12
|
export declare const createDecompressStreamSync: () => import("./index.js").DecompressStream;
|
|
13
|
-
export declare const compressionStream: (opts?: import("./index.js").
|
|
13
|
+
export declare const compressionStream: (opts?: import("./index.js").CompressionStreamOptions) => TransformStream<Uint8Array, Uint8Array>;
|
|
14
14
|
export declare const decompressionStream: () => TransformStream<Uint8Array, Uint8Array>;
|
|
15
15
|
/** Initializes this independently loaded WASM subpath. */
|
|
16
16
|
export declare const preload: () => Promise<void>;
|
|
17
17
|
export declare const version: () => Promise<string>;
|
|
18
18
|
export declare const setMaxDecompressedSize: (bytes: number) => Promise<void>;
|
|
19
19
|
export { CompressError } from "../../core/types.js";
|
|
20
|
-
export type { CompressOptions, DecompressOptions, AlgorithmName } from "../../core/types.js";
|
|
20
|
+
export type { CompressOptions, CompressionStreamOptions, DecompressOptions, AlgorithmName, } from "../../core/types.js";
|
|
21
21
|
export type { CompressStream, DecompressStream } from "../../core/dispatch.js";
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/lz4/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,cAAc,kFAA0B,CAAC;AACtD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6DAA6D;AAC7D,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/algorithms/lz4/index.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,QAAQ,yFAAoB,CAAC;AAC1C,6DAA6D;AAC7D,eAAO,MAAM,YAAY,gFAAwB,CAAC;AAClD,eAAO,MAAM,UAAU,2FAAsB,CAAC;AAC9C,6DAA6D;AAC7D,eAAO,MAAM,cAAc,kFAA0B,CAAC;AACtD,eAAO,MAAM,oBAAoB,+FAAgC,CAAC;AAClE,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,sFAAoC,CAAC;AAC1E,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6DAA6D;AAC7D,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,eAAO,MAAM,iBAAiB,mGAA6B,CAAC;AAC5D,eAAO,MAAM,mBAAmB,+CAA+B,CAAC;AAChE,0DAA0D;AAC1D,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AACxC,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EACR,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,aAAa,GAChB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
Binary file
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { DecompressOptions } from "../../../core/types.js";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Decodes a raw block. Pass `expectedSize` (an output capacity) when known: without it
|
|
4
|
+
* the block is decoded by the incremental stream decoder, which is much slower.
|
|
5
|
+
*/
|
|
3
6
|
export declare function decompress(input: Uint8Array, options?: DecompressOptions): Promise<Uint8Array>;
|
|
4
7
|
/** Decodes a raw block synchronously after preload(). */
|
|
5
8
|
export declare function decompressSync(input: Uint8Array, options?: DecompressOptions): Uint8Array;
|
|
@@ -8,4 +11,11 @@ export declare const version: () => Promise<string>;
|
|
|
8
11
|
export declare const setMaxDecompressedSize: (bytes: number) => Promise<void>;
|
|
9
12
|
export { CompressError } from "../../../core/types.js";
|
|
10
13
|
export type { DecompressOptions, AlgorithmName } from "../../../core/types.js";
|
|
14
|
+
/** Creates an incremental raw-block decoder; write() emits output as input arrives. */
|
|
15
|
+
export declare const createDecompressStream: () => Promise<import("./index.js").DecompressStream>;
|
|
16
|
+
/** Requires completed preload(), like other synchronous stream factories. */
|
|
17
|
+
export declare const createDecompressStreamSync: () => import("./index.js").DecompressStream;
|
|
18
|
+
/** Incrementally decodes one raw block through Web Streams. */
|
|
19
|
+
export declare const decompressionStream: () => TransformStream<Uint8Array, Uint8Array>;
|
|
20
|
+
export type { DecompressStream } from "../../../core/dispatch.js";
|
|
11
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/lz4_raw/decompress/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAQhE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/algorithms/lz4_raw/decompress/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAQhE;;;GAGG;AACH,wBAAsB,UAAU,CAC5B,KAAK,EAAE,UAAU,EACjB,OAAO,GAAE,iBAAsB,GAChC,OAAO,CAAC,UAAU,CAAC,CAGrB;AACD,yDAAyD;AACzD,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAG7F;AACD,eAAO,MAAM,OAAO,qBAAmB,CAAC;AACxC,eAAO,MAAM,OAAO,uBAAmB,CAAC;AACxC,eAAO,MAAM,sBAAsB,kCAAkC,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE/E,uFAAuF;AACvF,eAAO,MAAM,sBAAsB,sDAAkC,CAAC;AACtE,6EAA6E;AAC7E,eAAO,MAAM,0BAA0B,6CAAsC,CAAC;AAC9E,+DAA+D;AAC/D,eAAO,MAAM,mBAAmB,+CAA+B,CAAC;AAChE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -8,7 +8,10 @@ import { defineAlgorithm } from "../../../core/algorithm.js";
|
|
|
8
8
|
import { Algorithm } from "../../../core/types.js";
|
|
9
9
|
import { validateCapacity } from "../../../core/capacity.js";
|
|
10
10
|
const bindings = /*#__PURE__*/ defineAlgorithm(Algorithm.Lz4Raw, "lz4_raw", new URL("../../lz4/decompress/lz4.wasm", import.meta.url));
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Decodes a raw block. Pass `expectedSize` (an output capacity) when known: without it
|
|
13
|
+
* the block is decoded by the incremental stream decoder, which is much slower.
|
|
14
|
+
*/
|
|
12
15
|
export async function decompress(input, options = {}) {
|
|
13
16
|
validateCapacity("lz4_raw", "raw LZ4", options);
|
|
14
17
|
return bindings.decompress(input, options);
|
|
@@ -22,4 +25,10 @@ export const preload = bindings.preload;
|
|
|
22
25
|
export const version = bindings.version;
|
|
23
26
|
export const setMaxDecompressedSize = bindings.setMaxDecompressedSize;
|
|
24
27
|
export { CompressError } from "../../../core/types.js";
|
|
28
|
+
/** Creates an incremental raw-block decoder; write() emits output as input arrives. */
|
|
29
|
+
export const createDecompressStream = bindings.createDecompressStream;
|
|
30
|
+
/** Requires completed preload(), like other synchronous stream factories. */
|
|
31
|
+
export const createDecompressStreamSync = bindings.createDecompressStreamSync;
|
|
32
|
+
/** Incrementally decodes one raw block through Web Streams. */
|
|
33
|
+
export const decompressionStream = bindings.decompressionStream;
|
|
25
34
|
//# sourceMappingURL=index.js.map
|