@myrialabs/zipkit 0.0.6
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/LICENSE +21 -0
- package/README.md +329 -0
- package/dist/bench/corpus.d.ts +21 -0
- package/dist/bench/corpus.d.ts.map +1 -0
- package/dist/bench/corpus.js +92 -0
- package/dist/bench/corpus.js.map +1 -0
- package/dist/checksum.d.ts +29 -0
- package/dist/checksum.d.ts.map +1 -0
- package/dist/checksum.js +35 -0
- package/dist/checksum.js.map +1 -0
- package/dist/cli.d.ts +17 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +427 -0
- package/dist/cli.js.map +1 -0
- package/dist/codecs/brotli.d.ts +6 -0
- package/dist/codecs/brotli.d.ts.map +1 -0
- package/dist/codecs/brotli.js +15 -0
- package/dist/codecs/brotli.js.map +1 -0
- package/dist/codecs/bzip2.d.ts +6 -0
- package/dist/codecs/bzip2.d.ts.map +1 -0
- package/dist/codecs/bzip2.js +15 -0
- package/dist/codecs/bzip2.js.map +1 -0
- package/dist/codecs/deflate.d.ts +6 -0
- package/dist/codecs/deflate.d.ts.map +1 -0
- package/dist/codecs/deflate.js +25 -0
- package/dist/codecs/deflate.js.map +1 -0
- package/dist/codecs/gzip.d.ts +6 -0
- package/dist/codecs/gzip.d.ts.map +1 -0
- package/dist/codecs/gzip.js +25 -0
- package/dist/codecs/gzip.js.map +1 -0
- package/dist/codecs/image.d.ts +5 -0
- package/dist/codecs/image.d.ts.map +1 -0
- package/dist/codecs/image.js +16 -0
- package/dist/codecs/image.js.map +1 -0
- package/dist/codecs/index.d.ts +18 -0
- package/dist/codecs/index.d.ts.map +1 -0
- package/dist/codecs/index.js +18 -0
- package/dist/codecs/index.js.map +1 -0
- package/dist/codecs/lz4.d.ts +6 -0
- package/dist/codecs/lz4.d.ts.map +1 -0
- package/dist/codecs/lz4.js +17 -0
- package/dist/codecs/lz4.js.map +1 -0
- package/dist/codecs/lzma.d.ts +6 -0
- package/dist/codecs/lzma.d.ts.map +1 -0
- package/dist/codecs/lzma.js +15 -0
- package/dist/codecs/lzma.js.map +1 -0
- package/dist/codecs/snappy.d.ts +6 -0
- package/dist/codecs/snappy.d.ts.map +1 -0
- package/dist/codecs/snappy.js +14 -0
- package/dist/codecs/snappy.js.map +1 -0
- package/dist/codecs/video.d.ts +13 -0
- package/dist/codecs/video.d.ts.map +1 -0
- package/dist/codecs/video.js +26 -0
- package/dist/codecs/video.js.map +1 -0
- package/dist/codecs/xz.d.ts +6 -0
- package/dist/codecs/xz.d.ts.map +1 -0
- package/dist/codecs/xz.js +30 -0
- package/dist/codecs/xz.js.map +1 -0
- package/dist/codecs/zlib.d.ts +6 -0
- package/dist/codecs/zlib.d.ts.map +1 -0
- package/dist/codecs/zlib.js +15 -0
- package/dist/codecs/zlib.js.map +1 -0
- package/dist/codecs/zstd.d.ts +6 -0
- package/dist/codecs/zstd.d.ts.map +1 -0
- package/dist/codecs/zstd.js +24 -0
- package/dist/codecs/zstd.js.map +1 -0
- package/dist/compress.d.ts +20 -0
- package/dist/compress.d.ts.map +1 -0
- package/dist/compress.js +83 -0
- package/dist/compress.js.map +1 -0
- package/dist/delta.d.ts +30 -0
- package/dist/delta.d.ts.map +1 -0
- package/dist/delta.js +44 -0
- package/dist/delta.js.map +1 -0
- package/dist/detect.d.ts +46 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/detect.js +86 -0
- package/dist/detect.js.map +1 -0
- package/dist/dictionary.d.ts +37 -0
- package/dist/dictionary.d.ts.map +1 -0
- package/dist/dictionary.js +71 -0
- package/dist/dictionary.js.map +1 -0
- package/dist/engine.d.ts +102 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +204 -0
- package/dist/engine.js.map +1 -0
- package/dist/fsa.d.ts +54 -0
- package/dist/fsa.d.ts.map +1 -0
- package/dist/fsa.js +45 -0
- package/dist/fsa.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/internal.d.ts +21 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +42 -0
- package/dist/internal.js.map +1 -0
- package/dist/middleware/elysia.d.ts +15 -0
- package/dist/middleware/elysia.d.ts.map +1 -0
- package/dist/middleware/elysia.js +43 -0
- package/dist/middleware/elysia.js.map +1 -0
- package/dist/middleware/express.d.ts +17 -0
- package/dist/middleware/express.d.ts.map +1 -0
- package/dist/middleware/express.js +62 -0
- package/dist/middleware/express.js.map +1 -0
- package/dist/middleware/hono.d.ts +17 -0
- package/dist/middleware/hono.d.ts.map +1 -0
- package/dist/middleware/hono.js +41 -0
- package/dist/middleware/hono.js.map +1 -0
- package/dist/middleware/index.d.ts +14 -0
- package/dist/middleware/index.d.ts.map +1 -0
- package/dist/middleware/index.js +14 -0
- package/dist/middleware/index.js.map +1 -0
- package/dist/middleware/shared.d.ts +29 -0
- package/dist/middleware/shared.d.ts.map +1 -0
- package/dist/middleware/shared.js +47 -0
- package/dist/middleware/shared.js.map +1 -0
- package/dist/pack.d.ts +36 -0
- package/dist/pack.d.ts.map +1 -0
- package/dist/pack.js +75 -0
- package/dist/pack.js.map +1 -0
- package/dist/parallel/index.d.ts +56 -0
- package/dist/parallel/index.d.ts.map +1 -0
- package/dist/parallel/index.js +158 -0
- package/dist/parallel/index.js.map +1 -0
- package/dist/sevenzip/index.d.ts +45 -0
- package/dist/sevenzip/index.d.ts.map +1 -0
- package/dist/sevenzip/index.js +646 -0
- package/dist/sevenzip/index.js.map +1 -0
- package/dist/streams/index.d.ts +32 -0
- package/dist/streams/index.d.ts.map +1 -0
- package/dist/streams/index.js +74 -0
- package/dist/streams/index.js.map +1 -0
- package/dist/string.d.ts +38 -0
- package/dist/string.d.ts.map +1 -0
- package/dist/string.js +64 -0
- package/dist/string.js.map +1 -0
- package/dist/tar/index.d.ts +99 -0
- package/dist/tar/index.d.ts.map +1 -0
- package/dist/tar/index.js +380 -0
- package/dist/tar/index.js.map +1 -0
- package/dist/types.d.ts +59 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +22 -0
- package/dist/types.js.map +1 -0
- package/dist/workers/index.d.ts +58 -0
- package/dist/workers/index.d.ts.map +1 -0
- package/dist/workers/index.js +158 -0
- package/dist/workers/index.js.map +1 -0
- package/dist/workers/worker.d.ts +18 -0
- package/dist/workers/worker.d.ts.map +1 -0
- package/dist/workers/worker.js +45 -0
- package/dist/workers/worker.js.map +1 -0
- package/dist/zip/crypto/aes.d.ts +25 -0
- package/dist/zip/crypto/aes.d.ts.map +1 -0
- package/dist/zip/crypto/aes.js +156 -0
- package/dist/zip/crypto/aes.js.map +1 -0
- package/dist/zip/crypto/winzip.d.ts +28 -0
- package/dist/zip/crypto/winzip.d.ts.map +1 -0
- package/dist/zip/crypto/winzip.js +87 -0
- package/dist/zip/crypto/winzip.js.map +1 -0
- package/dist/zip/crypto/zipcrypto.d.ts +14 -0
- package/dist/zip/crypto/zipcrypto.d.ts.map +1 -0
- package/dist/zip/crypto/zipcrypto.js +65 -0
- package/dist/zip/crypto/zipcrypto.js.map +1 -0
- package/dist/zip/datetime.d.ts +9 -0
- package/dist/zip/datetime.d.ts.map +1 -0
- package/dist/zip/datetime.js +13 -0
- package/dist/zip/datetime.js.map +1 -0
- package/dist/zip/index.d.ts +134 -0
- package/dist/zip/index.d.ts.map +1 -0
- package/dist/zip/index.js +473 -0
- package/dist/zip/index.js.map +1 -0
- package/dist/zip/stream.d.ts +38 -0
- package/dist/zip/stream.d.ts.map +1 -0
- package/dist/zip/stream.js +240 -0
- package/dist/zip/stream.js.map +1 -0
- package/dist/zipkit.d.ts +74 -0
- package/dist/zipkit.d.ts.map +1 -0
- package/dist/zipkit.js +168 -0
- package/dist/zipkit.js.map +1 -0
- package/engine/dist/zipkit-engine.mjs +2 -0
- package/engine/dist/zipkit-engine.wasm +0 -0
- package/package.json +137 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zipkit — overkill compression for Node, Bun & the browser.
|
|
3
|
+
*
|
|
4
|
+
* One typed API over a single Wasm engine: gzip, deflate, zlib, zstd, lz4,
|
|
5
|
+
* snappy, brotli, lzma, bzip2, plus a ZIP container and lossless image/video
|
|
6
|
+
* codecs. ZipKit picks native speed where it wins and libdeflate density where
|
|
7
|
+
* ratio matters.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { gzip, gunzip, zstd, compress, decompress } from '@myrialabs/zipkit';
|
|
12
|
+
*
|
|
13
|
+
* const gz = await gzip(bytes); // named codec, async, lazy-loads the engine
|
|
14
|
+
* const back = await gunzip(gz);
|
|
15
|
+
* const small = await compress(bytes, 'zstd', { level: 19 });
|
|
16
|
+
* const orig = await decompress(small); // auto-detects the format
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export { gzip, gunzip, deflate, inflate, zlib, unzlib, zstd, unzstd, lz4, unlz4, snappy, unsnappy, brotli, unbrotli, lzma, unlzma, xz, unxz, bzip2, unbzip2, encodeImage, decodeImage, encodeFrames, decodeFrames, type FrameCodec } from './codecs/index.js';
|
|
20
|
+
export { compress, decompress, decompressWith } from './compress.js';
|
|
21
|
+
export { detectFormat, type DetectedFormat } from './detect.js';
|
|
22
|
+
export { pack, unpack } from './pack.js';
|
|
23
|
+
export { zip, unzip, listEntries, zipStream, type ZipEntryInput, type ZipEntry, type ZipEntryInfo, type ZipMethod, type UnzipOptions, type ZipStreamOptions } from './zip/index.js';
|
|
24
|
+
export { sevenZip, unSevenZip, type SevenZipEntryInput, type SevenZipEntry } from './sevenzip/index.js';
|
|
25
|
+
export { tar, untar, tarGz, untarGz, tarZstd, untarZstd, type TarEntryInput, type TarEntry, type TarEntryType } from './tar/index.js';
|
|
26
|
+
export { ZipKit, init } from './zipkit.js';
|
|
27
|
+
export { ZipKitEngine, getEngine } from './engine.js';
|
|
28
|
+
export { strToU8, strFromU8, DecodeUTF8, EncodeUTF8 } from './string.js';
|
|
29
|
+
export { crc32, verifyChecksum } from './checksum.js';
|
|
30
|
+
export { trainDictionary, compressWithDictionary, decompressWithDictionary, type TrainOptions } from './dictionary.js';
|
|
31
|
+
export { compressDelta, applyDelta } from './delta.js';
|
|
32
|
+
export { entriesFromFileHandles, zipToFileHandle, type FileLike, type ReadableFileHandle, type WritableFileHandle, type FileHandleEntryOptions } from './fsa.js';
|
|
33
|
+
export type { Bytes, Codec, CompressionMode, DeflateLevel, CompressOptions, DecompressOptions, ProgressCallback } from './types.js';
|
|
34
|
+
export { AbortError, ZipKitError } from './types.js';
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EACN,IAAI,EACJ,MAAM,EACN,OAAO,EACP,OAAO,EACP,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,MAAM,EACN,GAAG,EACH,KAAK,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,EAAE,EACF,IAAI,EACJ,KAAK,EACL,OAAO,EACP,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,KAAK,UAAU,EACf,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAGhE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,EACN,GAAG,EACH,KAAK,EACL,WAAW,EACX,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACN,QAAQ,EACR,UAAU,EACV,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACN,GAAG,EACH,KAAK,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGtD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGtD,OAAO,EACN,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,KAAK,YAAY,EACjB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGvD,OAAO,EACN,sBAAsB,EACtB,eAAe,EACf,KAAK,QAAQ,EACb,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,MAAM,UAAU,CAAC;AAGlB,YAAY,EACX,KAAK,EACL,KAAK,EACL,eAAe,EACf,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zipkit — overkill compression for Node, Bun & the browser.
|
|
3
|
+
*
|
|
4
|
+
* One typed API over a single Wasm engine: gzip, deflate, zlib, zstd, lz4,
|
|
5
|
+
* snappy, brotli, lzma, bzip2, plus a ZIP container and lossless image/video
|
|
6
|
+
* codecs. ZipKit picks native speed where it wins and libdeflate density where
|
|
7
|
+
* ratio matters.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { gzip, gunzip, zstd, compress, decompress } from '@myrialabs/zipkit';
|
|
12
|
+
*
|
|
13
|
+
* const gz = await gzip(bytes); // named codec, async, lazy-loads the engine
|
|
14
|
+
* const back = await gunzip(gz);
|
|
15
|
+
* const small = await compress(bytes, 'zstd', { level: 19 });
|
|
16
|
+
* const orig = await decompress(small); // auto-detects the format
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
// ---- Named codec helpers (async, tree-shakeable) ----
|
|
20
|
+
export { gzip, gunzip, deflate, inflate, zlib, unzlib, zstd, unzstd, lz4, unlz4, snappy, unsnappy, brotli, unbrotli, lzma, unlzma, xz, unxz, bzip2, unbzip2, encodeImage, decodeImage, encodeFrames, decodeFrames } from './codecs/index.js';
|
|
21
|
+
// ---- Generic dispatch + auto-detect ----
|
|
22
|
+
export { compress, decompress, decompressWith } from './compress.js';
|
|
23
|
+
export { detectFormat } from './detect.js';
|
|
24
|
+
// ---- "Smallest possible" pack/unpack (async, lazy-loads the engine) ----
|
|
25
|
+
export { pack, unpack } from './pack.js';
|
|
26
|
+
// ---- ZIP archive helpers ----
|
|
27
|
+
export { zip, unzip, listEntries, zipStream } from './zip/index.js';
|
|
28
|
+
// ---- 7z archive helpers ----
|
|
29
|
+
export { sevenZip, unSevenZip } from './sevenzip/index.js';
|
|
30
|
+
// ---- Tar archive helpers ----
|
|
31
|
+
export { tar, untar, tarGz, untarGz, tarZstd, untarZstd } from './tar/index.js';
|
|
32
|
+
// ---- High-level, synchronous class with native dispatch ----
|
|
33
|
+
export { ZipKit, init } from './zipkit.js';
|
|
34
|
+
// ---- Raw Wasm engine (escape hatch) ----
|
|
35
|
+
export { ZipKitEngine, getEngine } from './engine.js';
|
|
36
|
+
// ---- String <-> bytes helpers ----
|
|
37
|
+
export { strToU8, strFromU8, DecodeUTF8, EncodeUTF8 } from './string.js';
|
|
38
|
+
// ---- Explicit integrity helpers ----
|
|
39
|
+
export { crc32, verifyChecksum } from './checksum.js';
|
|
40
|
+
// ---- Zstd dictionary compression ----
|
|
41
|
+
export { trainDictionary, compressWithDictionary, decompressWithDictionary } from './dictionary.js';
|
|
42
|
+
// ---- Delta (incremental) compression for text/JSON ----
|
|
43
|
+
export { compressDelta, applyDelta } from './delta.js';
|
|
44
|
+
// ---- File System Access API helpers (browser) ----
|
|
45
|
+
export { entriesFromFileHandles, zipToFileHandle } from './fsa.js';
|
|
46
|
+
export { AbortError, ZipKitError } from './types.js';
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,wDAAwD;AACxD,OAAO,EACN,IAAI,EACJ,MAAM,EACN,OAAO,EACP,OAAO,EACP,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,MAAM,EACN,GAAG,EACH,KAAK,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,EAAE,EACF,IAAI,EACJ,KAAK,EACL,OAAO,EACP,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EAEZ,MAAM,mBAAmB,CAAC;AAE3B,2CAA2C;AAC3C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,YAAY,EAAuB,MAAM,aAAa,CAAC;AAEhE,2EAA2E;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEzC,gCAAgC;AAChC,OAAO,EACN,GAAG,EACH,KAAK,EACL,WAAW,EACX,SAAS,EAOT,MAAM,gBAAgB,CAAC;AAExB,+BAA+B;AAC/B,OAAO,EACN,QAAQ,EACR,UAAU,EAGV,MAAM,qBAAqB,CAAC;AAE7B,gCAAgC;AAChC,OAAO,EACN,GAAG,EACH,KAAK,EACL,KAAK,EACL,OAAO,EACP,OAAO,EACP,SAAS,EAIT,MAAM,gBAAgB,CAAC;AAExB,+DAA+D;AAC/D,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAE3C,2CAA2C;AAC3C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtD,qCAAqC;AACrC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzE,uCAAuC;AACvC,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEtD,wCAAwC;AACxC,OAAO,EACN,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EAExB,MAAM,iBAAiB,CAAC;AAEzB,0DAA0D;AAC1D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEvD,qDAAqD;AACrD,OAAO,EACN,sBAAsB,EACtB,eAAe,EAKf,MAAM,UAAU,CAAC;AAYlB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal helpers shared across codec façades. Not part of the public API.
|
|
3
|
+
*/
|
|
4
|
+
import { type CompressionMode, type CompressOptions, type DecompressOptions } from './types.js';
|
|
5
|
+
/** Clamp a level into `[min, max]`, falling back to `def` when undefined. */
|
|
6
|
+
export declare function clampLevel(level: number | undefined, min: number, max: number, def: number): number;
|
|
7
|
+
/** Resolve the public policy option to its default. */
|
|
8
|
+
export declare function compressionMode(opts?: CompressOptions): CompressionMode;
|
|
9
|
+
/** Pick a level from mode defaults unless the caller supplied one explicitly. */
|
|
10
|
+
export declare function levelForMode(opts: CompressOptions | undefined, min: number, max: number, defaults: Record<CompressionMode, number>): number;
|
|
11
|
+
export declare function bunRuntime(): any | undefined;
|
|
12
|
+
/** Throw {@link AbortError} if the signal is already aborted. */
|
|
13
|
+
export declare function throwIfAborted(signal?: AbortSignal): void;
|
|
14
|
+
/**
|
|
15
|
+
* Run a synchronous codec on the engine inside a Promise, honoring an
|
|
16
|
+
* `AbortSignal` at entry and reporting trivial start/finish progress. The
|
|
17
|
+
* engine itself is one-shot and cannot yield mid-call; for genuinely
|
|
18
|
+
* off-thread work use \`@myrialabs/zipkit/workers\`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function runAsync(work: () => Uint8Array, opts: CompressOptions | DecompressOptions | undefined, inputLen: number): Promise<Uint8Array>;
|
|
21
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE5G,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAInG;AAED,uDAAuD;AACvD,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,eAAe,CAEvE;AAED,iFAAiF;AACjF,wBAAgB,YAAY,CAC3B,IAAI,EAAE,eAAe,GAAG,SAAS,EACjC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,GACvC,MAAM,CAER;AAED,wBAAgB,UAAU,IAAI,GAAG,GAAG,SAAS,CAE5C;AAED,iEAAiE;AACjE,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAEzD;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAC7B,IAAI,EAAE,MAAM,UAAU,EACtB,IAAI,EAAE,eAAe,GAAG,iBAAiB,GAAG,SAAS,EACrD,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,UAAU,CAAC,CAMrB"}
|
package/dist/internal.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal helpers shared across codec façades. Not part of the public API.
|
|
3
|
+
*/
|
|
4
|
+
import { AbortError } from './types.js';
|
|
5
|
+
/** Clamp a level into `[min, max]`, falling back to `def` when undefined. */
|
|
6
|
+
export function clampLevel(level, min, max, def) {
|
|
7
|
+
if (level === undefined)
|
|
8
|
+
return def;
|
|
9
|
+
if (!Number.isFinite(level))
|
|
10
|
+
return def;
|
|
11
|
+
return Math.max(min, Math.min(max, Math.round(level)));
|
|
12
|
+
}
|
|
13
|
+
/** Resolve the public policy option to its default. */
|
|
14
|
+
export function compressionMode(opts) {
|
|
15
|
+
return opts?.mode ?? 'balanced';
|
|
16
|
+
}
|
|
17
|
+
/** Pick a level from mode defaults unless the caller supplied one explicitly. */
|
|
18
|
+
export function levelForMode(opts, min, max, defaults) {
|
|
19
|
+
return clampLevel(opts?.level, min, max, defaults[compressionMode(opts)]);
|
|
20
|
+
}
|
|
21
|
+
export function bunRuntime() {
|
|
22
|
+
return globalThis.Bun;
|
|
23
|
+
}
|
|
24
|
+
/** Throw {@link AbortError} if the signal is already aborted. */
|
|
25
|
+
export function throwIfAborted(signal) {
|
|
26
|
+
if (signal?.aborted)
|
|
27
|
+
throw new AbortError();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Run a synchronous codec on the engine inside a Promise, honoring an
|
|
31
|
+
* `AbortSignal` at entry and reporting trivial start/finish progress. The
|
|
32
|
+
* engine itself is one-shot and cannot yield mid-call; for genuinely
|
|
33
|
+
* off-thread work use \`@myrialabs/zipkit/workers\`.
|
|
34
|
+
*/
|
|
35
|
+
export async function runAsync(work, opts, inputLen) {
|
|
36
|
+
throwIfAborted(opts?.signal);
|
|
37
|
+
opts?.onProgress?.(0, 0);
|
|
38
|
+
const out = work();
|
|
39
|
+
opts?.onProgress?.(1, inputLen);
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAsE,MAAM,YAAY,CAAC;AAE5G,6EAA6E;AAC7E,MAAM,UAAU,UAAU,CAAC,KAAyB,EAAE,GAAW,EAAE,GAAW,EAAE,GAAW;IAC1F,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IACxC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,eAAe,CAAC,IAAsB;IACrD,OAAO,IAAI,EAAE,IAAI,IAAI,UAAU,CAAC;AACjC,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,YAAY,CAC3B,IAAiC,EACjC,GAAW,EACX,GAAW,EACX,QAAyC;IAEzC,OAAO,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,UAAU;IACzB,OAAQ,UAA4B,CAAC,GAAG,CAAC;AAC1C,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,cAAc,CAAC,MAAoB;IAClD,IAAI,MAAM,EAAE,OAAO;QAAE,MAAM,IAAI,UAAU,EAAE,CAAC;AAC7C,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC7B,IAAsB,EACtB,IAAqD,EACrD,QAAgB;IAEhB,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC7B,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACzB,MAAM,GAAG,GAAG,IAAI,EAAE,CAAC;IACnB,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAChC,OAAO,GAAG,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compression for Elysia, as an `onAfterHandle` hook. Negotiates
|
|
3
|
+
* `Accept-Encoding` and returns a compressed `Response` with the right headers.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { Elysia } from 'elysia';
|
|
8
|
+
* import { elysia as compression } from '@myrialabs/zipkit/middleware';
|
|
9
|
+
* const app = new Elysia().onAfterHandle(compression()).get('/', () => bigJson);
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
import { type CompressionOptions } from './shared.js';
|
|
13
|
+
/** Create an Elysia `onAfterHandle` compression hook. */
|
|
14
|
+
export declare function elysia(options?: CompressionOptions): (ctx: any) => Promise<Response | undefined>;
|
|
15
|
+
//# sourceMappingURL=elysia.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elysia.d.ts","sourceRoot":"","sources":["../../src/middleware/elysia.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAoC,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAExF,yDAAyD;AACzD,wBAAgB,MAAM,CAAC,OAAO,GAAE,kBAAuB,IAExC,KAAK,GAAG,KAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAuBtD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compression for Elysia, as an `onAfterHandle` hook. Negotiates
|
|
3
|
+
* `Accept-Encoding` and returns a compressed `Response` with the right headers.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { Elysia } from 'elysia';
|
|
8
|
+
* import { elysia as compression } from '@myrialabs/zipkit/middleware';
|
|
9
|
+
* const app = new Elysia().onAfterHandle(compression()).get('/', () => bigJson);
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
import { negotiate, compressBody, toBytes } from './shared.js';
|
|
13
|
+
/** Create an Elysia `onAfterHandle` compression hook. */
|
|
14
|
+
export function elysia(options = {}) {
|
|
15
|
+
const threshold = options.threshold ?? 1024;
|
|
16
|
+
return async (ctx) => {
|
|
17
|
+
const { response, request, set } = ctx;
|
|
18
|
+
const encoding = negotiate(request?.headers?.get?.('accept-encoding'), options.encodings);
|
|
19
|
+
if (!encoding)
|
|
20
|
+
return undefined;
|
|
21
|
+
// Normalize the handler's return value into bytes.
|
|
22
|
+
let body = null;
|
|
23
|
+
if (response instanceof Response) {
|
|
24
|
+
if (response.headers.get('Content-Encoding'))
|
|
25
|
+
return undefined;
|
|
26
|
+
body = new Uint8Array(await response.arrayBuffer());
|
|
27
|
+
}
|
|
28
|
+
else if (typeof response === 'object' && response !== null) {
|
|
29
|
+
body = new TextEncoder().encode(JSON.stringify(response));
|
|
30
|
+
set.headers['Content-Type'] ??= 'application/json';
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
body = toBytes(response);
|
|
34
|
+
}
|
|
35
|
+
if (!body || body.length < threshold)
|
|
36
|
+
return undefined;
|
|
37
|
+
const compressed = await compressBody(body, encoding, options.level);
|
|
38
|
+
set.headers['Content-Encoding'] = encoding;
|
|
39
|
+
set.headers['Vary'] = 'Accept-Encoding';
|
|
40
|
+
return new Response(compressed, { headers: set.headers, status: set.status ?? 200 });
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=elysia.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elysia.js","sourceRoot":"","sources":["../../src/middleware/elysia.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAA2B,MAAM,aAAa,CAAC;AAExF,yDAAyD;AACzD,MAAM,UAAU,MAAM,CAAC,UAA8B,EAAE;IACtD,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC;IAC5C,OAAO,KAAK,EAAE,GAAQ,EAAiC,EAAE;QACxD,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;QACvC,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1F,IAAI,CAAC,QAAQ;YAAE,OAAO,SAAS,CAAC;QAEhC,mDAAmD;QACnD,IAAI,IAAI,GAAsB,IAAI,CAAC;QACnC,IAAI,QAAQ,YAAY,QAAQ,EAAE,CAAC;YAClC,IAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;gBAAE,OAAO,SAAS,CAAC;YAC/D,IAAI,GAAG,IAAI,UAAU,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QACrD,CAAC;aAAM,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YAC9D,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;YAC1D,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,kBAAkB,CAAC;QACpD,CAAC;aAAM,CAAC;YACP,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC1B,CAAC;QACD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,SAAS;YAAE,OAAO,SAAS,CAAC;QAEvD,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QACrE,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG,QAAQ,CAAC;QAC3C,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,iBAAiB,CAAC;QACxC,OAAO,IAAI,QAAQ,CAAC,UAAiB,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC;IAC7F,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compression middleware for Express / Connect. Buffers the response, then
|
|
3
|
+
* compresses on `end()` with the best supported codec when the client accepts
|
|
4
|
+
* one and the body clears the size threshold.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import express from 'express';
|
|
9
|
+
* import { express as compression } from '@myrialabs/zipkit/middleware';
|
|
10
|
+
* const app = express();
|
|
11
|
+
* app.use(compression());
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
import { type CompressionOptions } from './shared.js';
|
|
15
|
+
/** Create an Express compression middleware. */
|
|
16
|
+
export declare function express(options?: CompressionOptions): (req: any, res: any, next: () => void) => void;
|
|
17
|
+
//# sourceMappingURL=express.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"express.d.ts","sourceRoot":"","sources":["../../src/middleware/express.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAoC,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAExF,gDAAgD;AAChD,wBAAgB,OAAO,CAAC,OAAO,GAAE,kBAAuB,IAE/C,KAAK,GAAG,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,IAAI,KAAG,IAAI,CA6CnD"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compression middleware for Express / Connect. Buffers the response, then
|
|
3
|
+
* compresses on `end()` with the best supported codec when the client accepts
|
|
4
|
+
* one and the body clears the size threshold.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import express from 'express';
|
|
9
|
+
* import { express as compression } from '@myrialabs/zipkit/middleware';
|
|
10
|
+
* const app = express();
|
|
11
|
+
* app.use(compression());
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
import { negotiate, compressBody, toBytes } from './shared.js';
|
|
15
|
+
/** Create an Express compression middleware. */
|
|
16
|
+
export function express(options = {}) {
|
|
17
|
+
const threshold = options.threshold ?? 1024;
|
|
18
|
+
return (req, res, next) => {
|
|
19
|
+
const encoding = negotiate(req.headers?.['accept-encoding'], options.encodings);
|
|
20
|
+
if (!encoding)
|
|
21
|
+
return next();
|
|
22
|
+
const chunks = [];
|
|
23
|
+
const origWrite = res.write.bind(res);
|
|
24
|
+
const origEnd = res.end.bind(res);
|
|
25
|
+
res.write = (chunk, ...rest) => {
|
|
26
|
+
const bytes = toBytes(chunk);
|
|
27
|
+
if (bytes)
|
|
28
|
+
chunks.push(bytes);
|
|
29
|
+
else
|
|
30
|
+
return origWrite(chunk, ...rest);
|
|
31
|
+
return true;
|
|
32
|
+
};
|
|
33
|
+
res.end = (chunk, ...rest) => {
|
|
34
|
+
const tail = toBytes(chunk);
|
|
35
|
+
if (tail)
|
|
36
|
+
chunks.push(tail);
|
|
37
|
+
const total = chunks.reduce((n, c) => n + c.length, 0);
|
|
38
|
+
const body = new Uint8Array(total);
|
|
39
|
+
let off = 0;
|
|
40
|
+
for (const ch of chunks) {
|
|
41
|
+
body.set(ch, off);
|
|
42
|
+
off += ch.length;
|
|
43
|
+
}
|
|
44
|
+
if (body.length < threshold || res.getHeader('Content-Encoding')) {
|
|
45
|
+
res.write = origWrite;
|
|
46
|
+
res.end = origEnd;
|
|
47
|
+
return origEnd(body, ...rest);
|
|
48
|
+
}
|
|
49
|
+
void compressBody(body, encoding, options.level).then((compressed) => {
|
|
50
|
+
res.setHeader('Content-Encoding', encoding);
|
|
51
|
+
res.setHeader('Vary', 'Accept-Encoding');
|
|
52
|
+
res.removeHeader('Content-Length');
|
|
53
|
+
res.write = origWrite;
|
|
54
|
+
res.end = origEnd;
|
|
55
|
+
origEnd(Buffer.from(compressed), ...rest);
|
|
56
|
+
});
|
|
57
|
+
return res;
|
|
58
|
+
};
|
|
59
|
+
next();
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=express.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"express.js","sourceRoot":"","sources":["../../src/middleware/express.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compression middleware for Hono. Negotiates `Accept-Encoding`, compresses the
|
|
3
|
+
* response body with the best supported codec (brotli → zstd → gzip → deflate),
|
|
4
|
+
* and sets `Content-Encoding` / `Vary`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { Hono } from 'hono';
|
|
9
|
+
* import { hono as compress } from '@myrialabs/zipkit/middleware';
|
|
10
|
+
* const app = new Hono();
|
|
11
|
+
* app.use('*', compress());
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
import { type CompressionOptions } from './shared.js';
|
|
15
|
+
/** Create a Hono compression middleware. */
|
|
16
|
+
export declare function hono(options?: CompressionOptions): (c: any, next: () => Promise<void>) => Promise<void>;
|
|
17
|
+
//# sourceMappingURL=hono.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hono.d.ts","sourceRoot":"","sources":["../../src/middleware/hono.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAA2B,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/E,4CAA4C;AAC5C,wBAAgB,IAAI,CAAC,OAAO,GAAE,kBAAuB,IAEtC,GAAG,GAAG,EAAE,MAAM,MAAM,OAAO,CAAC,IAAI,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC,CAqB/D"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compression middleware for Hono. Negotiates `Accept-Encoding`, compresses the
|
|
3
|
+
* response body with the best supported codec (brotli → zstd → gzip → deflate),
|
|
4
|
+
* and sets `Content-Encoding` / `Vary`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { Hono } from 'hono';
|
|
9
|
+
* import { hono as compress } from '@myrialabs/zipkit/middleware';
|
|
10
|
+
* const app = new Hono();
|
|
11
|
+
* app.use('*', compress());
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
import { negotiate, compressBody } from './shared.js';
|
|
15
|
+
/** Create a Hono compression middleware. */
|
|
16
|
+
export function hono(options = {}) {
|
|
17
|
+
const threshold = options.threshold ?? 1024;
|
|
18
|
+
return async (c, next) => {
|
|
19
|
+
await next();
|
|
20
|
+
const res = c.res;
|
|
21
|
+
if (!res || !res.body)
|
|
22
|
+
return;
|
|
23
|
+
if (res.headers.get('Content-Encoding'))
|
|
24
|
+
return; // already encoded
|
|
25
|
+
const encoding = negotiate(c.req.header('Accept-Encoding'), options.encodings);
|
|
26
|
+
if (!encoding)
|
|
27
|
+
return;
|
|
28
|
+
const original = new Uint8Array(await res.arrayBuffer());
|
|
29
|
+
if (original.length < threshold) {
|
|
30
|
+
c.res = new Response(original, res);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const compressed = await compressBody(original, encoding, options.level);
|
|
34
|
+
const headers = new Headers(res.headers);
|
|
35
|
+
headers.set('Content-Encoding', encoding);
|
|
36
|
+
headers.set('Vary', 'Accept-Encoding');
|
|
37
|
+
headers.delete('Content-Length');
|
|
38
|
+
c.res = new Response(compressed, { status: res.status, headers });
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=hono.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hono.js","sourceRoot":"","sources":["../../src/middleware/hono.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,SAAS,EAAE,YAAY,EAA2B,MAAM,aAAa,CAAC;AAE/E,4CAA4C;AAC5C,MAAM,UAAU,IAAI,CAAC,UAA8B,EAAE;IACpD,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC;IAC5C,OAAO,KAAK,EAAE,CAAM,EAAE,IAAyB,EAAiB,EAAE;QACjE,MAAM,IAAI,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC;QAClB,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI;YAAE,OAAO;QAC9B,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;YAAE,OAAO,CAAC,kBAAkB;QAEnE,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;QAC/E,IAAI,CAAC,QAAQ;YAAE,OAAO;QAEtB,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;QACzD,IAAI,QAAQ,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;YACjC,CAAC,CAAC,GAAG,GAAG,IAAI,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;YACpC,OAAO;QACR,CAAC;QACD,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QACzE,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;QAC1C,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;QACvC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;QACjC,CAAC,CAAC,GAAG,GAAG,IAAI,QAAQ,CAAC,UAAiC,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IAC1F,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP compression middleware for popular frameworks. Each adapter negotiates
|
|
3
|
+
* `Accept-Encoding` and compresses responses with the best codec the client
|
|
4
|
+
* supports (brotli → zstd → gzip → deflate).
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { elysia, express, hono } from '@myrialabs/zipkit/middleware';
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
export { elysia } from './elysia.js';
|
|
11
|
+
export { express } from './express.js';
|
|
12
|
+
export { hono } from './hono.js';
|
|
13
|
+
export { negotiate, type CompressionOptions, type Encoding } from './shared.js';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/middleware/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,KAAK,kBAAkB,EAAE,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP compression middleware for popular frameworks. Each adapter negotiates
|
|
3
|
+
* `Accept-Encoding` and compresses responses with the best codec the client
|
|
4
|
+
* supports (brotli → zstd → gzip → deflate).
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { elysia, express, hono } from '@myrialabs/zipkit/middleware';
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
export { elysia } from './elysia.js';
|
|
11
|
+
export { express } from './express.js';
|
|
12
|
+
export { hono } from './hono.js';
|
|
13
|
+
export { negotiate } from './shared.js';
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/middleware/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAA0C,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared HTTP compression helpers used by the framework adapters. Handles
|
|
3
|
+
* `Accept-Encoding` negotiation and maps a chosen encoding to a ZipKit codec.
|
|
4
|
+
*/
|
|
5
|
+
/** HTTP content codings ZipKit can emit, best-ratio first. */
|
|
6
|
+
export type Encoding = 'br' | 'zstd' | 'gzip' | 'deflate';
|
|
7
|
+
/** Default server preference order (highest ratio first). */
|
|
8
|
+
export declare const DEFAULT_ENCODINGS: Encoding[];
|
|
9
|
+
export interface CompressionOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Encodings the server is willing to emit, in preference order. The first
|
|
12
|
+
* one the client also accepts wins. Defaults to `['br','zstd','gzip','deflate']`.
|
|
13
|
+
*/
|
|
14
|
+
encodings?: Encoding[];
|
|
15
|
+
/** Don't compress responses smaller than this many bytes. Default `1024`. */
|
|
16
|
+
threshold?: number;
|
|
17
|
+
/** Compression level passed to the chosen codec. */
|
|
18
|
+
level?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Pick the best mutually-supported encoding from an `Accept-Encoding` header,
|
|
22
|
+
* or `null` if none match (or the client sent `identity;q=0`-style refusals).
|
|
23
|
+
*/
|
|
24
|
+
export declare function negotiate(acceptEncoding: string | null | undefined, encodings?: Encoding[]): Encoding | null;
|
|
25
|
+
/** Compress a response body for the negotiated `encoding`. */
|
|
26
|
+
export declare function compressBody(body: Uint8Array, encoding: Encoding, level?: number): Promise<Uint8Array>;
|
|
27
|
+
/** Coerce common body shapes into bytes. */
|
|
28
|
+
export declare function toBytes(body: unknown): Uint8Array | null;
|
|
29
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/middleware/shared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,8DAA8D;AAC9D,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAS1D,6DAA6D;AAC7D,eAAO,MAAM,iBAAiB,EAAE,QAAQ,EAAsC,CAAC;AAE/E,MAAM,WAAW,kBAAkB;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,SAAS,aAAoB,GAAG,QAAQ,GAAG,IAAI,CAYnH;AAED,8DAA8D;AAC9D,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAEtG;AAED,4CAA4C;AAC5C,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAMxD"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared HTTP compression helpers used by the framework adapters. Handles
|
|
3
|
+
* `Accept-Encoding` negotiation and maps a chosen encoding to a ZipKit codec.
|
|
4
|
+
*/
|
|
5
|
+
import { compress } from '../compress.js';
|
|
6
|
+
const ENCODING_TO_CODEC = {
|
|
7
|
+
br: 'brotli',
|
|
8
|
+
zstd: 'zstd',
|
|
9
|
+
gzip: 'gzip',
|
|
10
|
+
deflate: 'zlib'
|
|
11
|
+
};
|
|
12
|
+
/** Default server preference order (highest ratio first). */
|
|
13
|
+
export const DEFAULT_ENCODINGS = ['br', 'zstd', 'gzip', 'deflate'];
|
|
14
|
+
/**
|
|
15
|
+
* Pick the best mutually-supported encoding from an `Accept-Encoding` header,
|
|
16
|
+
* or `null` if none match (or the client sent `identity;q=0`-style refusals).
|
|
17
|
+
*/
|
|
18
|
+
export function negotiate(acceptEncoding, encodings = DEFAULT_ENCODINGS) {
|
|
19
|
+
if (!acceptEncoding)
|
|
20
|
+
return null;
|
|
21
|
+
const accepted = new Set(acceptEncoding
|
|
22
|
+
.split(',')
|
|
23
|
+
.map((part) => part.trim().split(';')[0].trim().toLowerCase())
|
|
24
|
+
.filter(Boolean));
|
|
25
|
+
for (const enc of encodings) {
|
|
26
|
+
if (accepted.has(enc) || accepted.has('*'))
|
|
27
|
+
return enc;
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
/** Compress a response body for the negotiated `encoding`. */
|
|
32
|
+
export function compressBody(body, encoding, level) {
|
|
33
|
+
return compress(body, ENCODING_TO_CODEC[encoding], { level });
|
|
34
|
+
}
|
|
35
|
+
/** Coerce common body shapes into bytes. */
|
|
36
|
+
export function toBytes(body) {
|
|
37
|
+
if (body == null)
|
|
38
|
+
return null;
|
|
39
|
+
if (body instanceof Uint8Array)
|
|
40
|
+
return body;
|
|
41
|
+
if (body instanceof ArrayBuffer)
|
|
42
|
+
return new Uint8Array(body);
|
|
43
|
+
if (typeof body === 'string')
|
|
44
|
+
return new TextEncoder().encode(body);
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/middleware/shared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAK1C,MAAM,iBAAiB,GAA4B;IAClD,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,MAAM;CACf,CAAC;AAEF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,iBAAiB,GAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;AAc/E;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,cAAyC,EAAE,SAAS,GAAG,iBAAiB;IACjG,IAAI,CAAC,cAAc;QAAE,OAAO,IAAI,CAAC;IACjC,MAAM,QAAQ,GAAG,IAAI,GAAG,CACvB,cAAc;SACZ,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;SAC9D,MAAM,CAAC,OAAO,CAAC,CACjB,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC7B,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,GAAG,CAAC;IACxD,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,YAAY,CAAC,IAAgB,EAAE,QAAkB,EAAE,KAAc;IAChF,OAAO,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;AAC/D,CAAC;AAED,4CAA4C;AAC5C,MAAM,UAAU,OAAO,CAAC,IAAa;IACpC,IAAI,IAAI,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IAC9B,IAAI,IAAI,YAAY,UAAU;QAAE,OAAO,IAAI,CAAC;IAC5C,IAAI,IAAI,YAAY,WAAW;QAAE,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;IAC7D,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACpE,OAAO,IAAI,CAAC;AACb,CAAC"}
|
package/dist/pack.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Smallest possible" packing.
|
|
3
|
+
*
|
|
4
|
+
* `pack()` tries the densest codecs (brotli, lzma, bzip2, zstd-ultra) and keeps
|
|
5
|
+
* the smallest result, tagged with a one-byte codec id so `unpack()` can
|
|
6
|
+
* reverse it without being told which codec won. Use it when output size
|
|
7
|
+
* matters more than compression time and both ends are ZipKit.
|
|
8
|
+
*
|
|
9
|
+
* The async {@link pack}/{@link unpack} helpers lazily load the shared engine;
|
|
10
|
+
* the synchronous {@link packSync}/{@link unpackSync} take an already-loaded
|
|
11
|
+
* engine and back {@link import('./zipkit.js').ZipKit.pack}.
|
|
12
|
+
*/
|
|
13
|
+
import { type ZipKitEngine } from './engine.js';
|
|
14
|
+
/** Codec name for each pack tag, indexed by the leading tag byte. */
|
|
15
|
+
export declare const PACK_CODECS: readonly ["brotli", "lzma", "bzip2", "zstd"];
|
|
16
|
+
/** Pack with an already-loaded engine. */
|
|
17
|
+
export declare function packSync(engine: ZipKitEngine, data: Uint8Array): Uint8Array;
|
|
18
|
+
/** Reverse {@link packSync} with an already-loaded engine. */
|
|
19
|
+
export declare function unpackSync(engine: ZipKitEngine, data: Uint8Array): Uint8Array;
|
|
20
|
+
/**
|
|
21
|
+
* Compress to the smallest output across brotli/lzma/bzip2/zstd-ultra, tagged so
|
|
22
|
+
* {@link unpack} can reverse it. Async; lazily loads the shared engine. For the
|
|
23
|
+
* synchronous form load an engine once via `ZipKit.load()` and call
|
|
24
|
+
* {@link import('./zipkit.js').ZipKit.pack}.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { pack, unpack } from '@myrialabs/zipkit';
|
|
29
|
+
* const small = await pack(bytes);
|
|
30
|
+
* const orig = await unpack(small);
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function pack(data: Uint8Array): Promise<Uint8Array>;
|
|
34
|
+
/** Reverse {@link pack}. Async; lazily loads the shared engine. */
|
|
35
|
+
export declare function unpack(data: Uint8Array): Promise<Uint8Array>;
|
|
36
|
+
//# sourceMappingURL=pack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack.d.ts","sourceRoot":"","sources":["../src/pack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAQ3D,qEAAqE;AACrE,eAAO,MAAM,WAAW,8CAA+C,CAAC;AAExE,0CAA0C;AAC1C,wBAAgB,QAAQ,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CAa3E;AAED,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CAe7E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAEhE;AAED,mEAAmE;AACnE,wBAAsB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAElE"}
|