compress-utils 0.9.0 → 0.11.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 +131 -82
- package/THIRD_PARTY_NOTICES.md +1 -1
- 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/decompress/index.d.ts +3 -3
- package/dist/algorithms/brotli/decompress/index.d.ts.map +1 -1
- package/dist/algorithms/brotli/index.d.ts +4 -4
- 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/decompress/index.d.ts +3 -3
- package/dist/algorithms/bz2/decompress/index.d.ts.map +1 -1
- package/dist/algorithms/bz2/index.d.ts +4 -4
- 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/decompress/index.d.ts +3 -3
- package/dist/algorithms/deflate/decompress/index.d.ts.map +1 -1
- package/dist/algorithms/deflate/index.d.ts +4 -4
- 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/decompress/index.d.ts +3 -3
- package/dist/algorithms/gzip/decompress/index.d.ts.map +1 -1
- package/dist/algorithms/gzip/gzip.wasm +0 -0
- package/dist/algorithms/gzip/index.d.ts +4 -4
- 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/index.d.ts +3 -3
- package/dist/algorithms/lz4/decompress/index.d.ts.map +1 -1
- package/dist/algorithms/lz4/decompress/lz4.wasm +0 -0
- package/dist/algorithms/lz4/index.d.ts +4 -4
- 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 +12 -2
- 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 +12 -2
- 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 +14 -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/index.d.ts +3 -3
- package/dist/algorithms/snappy/decompress/index.d.ts.map +1 -1
- package/dist/algorithms/snappy/decompress/snappy.wasm +0 -0
- package/dist/algorithms/snappy/index.d.ts +4 -4
- 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/index.d.ts +3 -3
- package/dist/algorithms/xz/decompress/index.d.ts.map +1 -1
- package/dist/algorithms/xz/decompress/xz.wasm +0 -0
- package/dist/algorithms/xz/index.d.ts +4 -4
- 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/index.d.ts +3 -3
- package/dist/algorithms/zlib/decompress/index.d.ts.map +1 -1
- package/dist/algorithms/zlib/decompress/zlib.wasm +0 -0
- package/dist/algorithms/zlib/index.d.ts +4 -4
- 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/index.d.ts +3 -3
- package/dist/algorithms/zstd/decompress/index.d.ts.map +1 -1
- package/dist/algorithms/zstd/decompress/zstd.wasm +0 -0
- package/dist/algorithms/zstd/index.d.ts +4 -4
- 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 +49 -10
- package/dist/core/dispatch.d.ts.map +1 -1
- package/dist/core/dispatch.js +85 -11
- package/dist/core/dispatch.js.map +1 -1
- package/dist/core/loader.d.ts +4 -0
- package/dist/core/loader.d.ts.map +1 -1
- package/dist/core/loader.js.map +1 -1
- package/dist/core/types.d.ts +22 -0
- package/dist/core/types.d.ts.map +1 -1
- package/package.json +2 -1
package/dist/core/types.d.ts
CHANGED
|
@@ -48,6 +48,28 @@ export interface CompressOptions {
|
|
|
48
48
|
/** 1..10. 1 = fastest, 10 = smallest. Default 5. */
|
|
49
49
|
level?: number;
|
|
50
50
|
}
|
|
51
|
+
export interface CompressionStreamOptions extends CompressOptions {
|
|
52
|
+
/**
|
|
53
|
+
* Flush after every chunk, so each output chunk is decodable on arrival
|
|
54
|
+
* while the stream stays open: for request/response or message streams
|
|
55
|
+
* such as a WebSocket. Costs a few bytes per chunk. Not supported by
|
|
56
|
+
* snappy and bz2, which can't flush mid-stream.
|
|
57
|
+
*/
|
|
58
|
+
flushEachChunk?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface DecompressStreamOptions {
|
|
61
|
+
/**
|
|
62
|
+
* Stop at the end of the first frame/member/stream instead of decoding
|
|
63
|
+
* concatenated frames as one stream (the default). Once `eof` is true,
|
|
64
|
+
* `unusedData` holds the input bytes written after the end, so the caller
|
|
65
|
+
* can read whatever follows (another message, a container's own bytes).
|
|
66
|
+
* A write with data after the end throws `CompressError` (code
|
|
67
|
+
* `StreamFinished`, 10); empty writes and `finish()` return empty output.
|
|
68
|
+
* Snappy emits nothing until its block is complete. Not supported by
|
|
69
|
+
* raw LZ4 and LZO (throws `UnsupportedAlgo`, 5).
|
|
70
|
+
*/
|
|
71
|
+
singleStream?: boolean;
|
|
72
|
+
}
|
|
51
73
|
export interface DecompressOptions {
|
|
52
74
|
/**
|
|
53
75
|
* Decompressed size in bytes if known by the caller. Skips the
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,gBAAgB;AAChB,0BAAkB,SAAS;IACvB,IAAI,IAAI;IACR,MAAM,IAAI;IACV,IAAI,IAAI;IACR,GAAG,IAAI;IACP,GAAG,IAAI;IACP,EAAE,IAAI;IACN,IAAI,IAAI;IACR,MAAM,IAAI;IACV,IAAI,IAAI;IACR,OAAO,IAAI;IACX,MAAM,KAAK;IACX,GAAG,KAAK;CACX;AAED,gBAAgB;AAChB,0BAAkB,MAAM;IACpB,EAAE,IAAI;IACN,UAAU,IAAI;IACd,YAAY,IAAI;IAChB,WAAW,IAAI;IACf,WAAW,IAAI;IACf,eAAe,IAAI;IACnB,WAAW,IAAI;IACf,aAAa,IAAI;IACjB,SAAS,IAAI;IACb,SAAS,IAAI;IACb,cAAc,KAAK;IACnB,WAAW,KAAK;IAChB,GAAG,KAAK;IACR,QAAQ,KAAK;CAChB;AAED,4CAA4C;AAC5C,MAAM,MAAM,aAAa,GACnB,MAAM,GACN,QAAQ,GACR,MAAM,GACN,KAAK,GACL,KAAK,GACL,IAAI,GACJ,QAAQ,GACR,MAAM,GACN,SAAS,GACT,SAAS,GACT,KAAK,CAAC;AAEZ,+EAA+E;AAC/E,qBAAa,aAAc,SAAQ,KAAK;IACpC,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;IAElC,YAAY,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAKlE;CACJ;AAED,MAAM,WAAW,eAAe;IAC5B,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAC9B;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,gBAAgB;AAChB,0BAAkB,SAAS;IACvB,IAAI,IAAI;IACR,MAAM,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package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "compress-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "WASM compression bindings for zstd, brotli, zlib, bz2, lz4, xz, snappy, gzip - all tree-shakeable.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -103,6 +103,7 @@
|
|
|
103
103
|
"@biomejs/biome": "2.5.9",
|
|
104
104
|
"@playwright/test": "^1.60.0",
|
|
105
105
|
"@types/node": "^26.2.0",
|
|
106
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
106
107
|
"esbuild": "^0.28.0",
|
|
107
108
|
"typescript": "^7.0.2",
|
|
108
109
|
"vitest": "^4.1.6"
|