@zip.js/zip.js 2.8.44 → 2.8.46
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 +28 -2
- package/deno.json +32 -2
- package/dist/zip-core-external.js +199 -149
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +196 -120
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +251 -157
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +227 -126
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +272 -1751
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +273 -1726
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +273 -1726
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +198 -122
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +200 -124
- package/dist/zip-native.min.js +1 -1
- package/dist/zip-web-worker-native.js +1 -1
- package/dist/zip-web-worker.js +1 -1
- package/dist/zip.js +200 -124
- package/dist/zip.min.js +1 -1
- package/eslint.config.mjs +31 -2
- package/index-native.cjs +273 -1726
- package/index-native.min.js +1 -1
- package/index.cjs +273 -1726
- package/index.d.cts +140 -2
- package/index.d.ts +140 -2
- package/index.min.js +1 -1
- package/lib/core/codec-pool.js +3 -2
- package/lib/core/codec-worker.js +30 -14
- package/lib/core/configuration.js +20 -2
- package/lib/core/constants.js +4 -0
- package/lib/core/options.js +2 -0
- package/lib/core/streams/aes-crypto-stream.js +15 -18
- package/lib/core/streams/codec-stream.js +2 -2
- package/lib/core/streams/zip-entry-stream.js +13 -18
- package/lib/core/util/mime-type-data.js +3 -0
- package/lib/core/util/mime-type.js +23 -1596
- package/lib/core/web-worker-base.js +29 -2
- package/lib/core/web-worker-inline-native.js +1 -1
- package/lib/core/web-worker-inline-wasm.js +1 -1
- package/lib/core/web-worker-native.js +7 -9
- package/lib/core/web-worker-wasm.js +9 -12
- package/lib/core/zip-entry.js +8 -1
- package/lib/core/zip-fs.js +62 -5
- package/lib/core/zip-reader.js +45 -17
- package/lib/core/zip-writer.js +58 -44
- package/lib/{core/web-worker-inline-template.js → zip-core-custom.js} +13 -20
- package/lib/zip-core-external.js +2 -0
- package/lib/zip-fs-core-external.js +2 -0
- package/lib/zip-fs-external.js +2 -0
- package/lib/zip-mime-types.js +2 -0
- package/lib/zip-module-native.js +3 -3
- package/lib/zip-module-wasm-base.js +3 -3
- package/package.json +28 -4
- package/worker-message-property-names.js +1 -1
- package/lib/core/web-worker-inline-template-native.js +0 -48
- package/lib/core/zlib-streams-inline-template.js +0 -45
package/README.md
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
zip.js is a JavaScript open-source library (BSD-3-Clause license) for
|
|
4
4
|
compressing and decompressing zip files. It has been designed to handle large amounts
|
|
5
5
|
of data. It supports notably multi-core compression, native compression with
|
|
6
|
-
compression streams, archives larger than 4GB
|
|
7
|
-
encryption, incremental writing, and
|
|
6
|
+
compression streams, pluggable compression engines, archives larger than 4GB
|
|
7
|
+
with Zip64, split zip files, data encryption, incremental writing, and
|
|
8
|
+
Deflate64 decompression.
|
|
8
9
|
|
|
9
10
|
# Demo
|
|
10
11
|
|
|
@@ -171,6 +172,31 @@ function downloadFile(blob) {
|
|
|
171
172
|
|
|
172
173
|
Run the code on Plunker: https://plnkr.co/edit/4sVljNIpqSUE9HCA?preview
|
|
173
174
|
|
|
175
|
+
## Custom web workers and compression engines
|
|
176
|
+
|
|
177
|
+
zip.js can create its web workers with the standard bundler pattern and
|
|
178
|
+
delegate compression/decompression to a custom engine, e.g.
|
|
179
|
+
[fflate](https://github.com/101arrowz/fflate):
|
|
180
|
+
|
|
181
|
+
```js
|
|
182
|
+
import { configure } from "@zip.js/zip.js/lib/zip-core-custom.js";
|
|
183
|
+
|
|
184
|
+
configure({
|
|
185
|
+
createWorker: () => new Worker(new URL("./zip-worker.js", import.meta.url), { type: "module" })
|
|
186
|
+
});
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
```js
|
|
190
|
+
// zip-worker.js
|
|
191
|
+
import { initWorker } from "@zip.js/zip.js/worker";
|
|
192
|
+
import { CompressionStreamFallback, DecompressionStreamFallback } from "./fflate-streams.js";
|
|
193
|
+
|
|
194
|
+
initWorker({ CompressionStreamFallback, DecompressionStreamFallback });
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
See https://gildas-lormeau.github.io/zip.js/#custom-workers for a complete
|
|
198
|
+
guide.
|
|
199
|
+
|
|
174
200
|
## Tests
|
|
175
201
|
|
|
176
202
|
See https://github.com/gildas-lormeau/zip.js/tree/master/tests/all
|
package/deno.json
CHANGED
|
@@ -1,17 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zip-js/zip-js",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.46",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": "./index.js",
|
|
6
6
|
"./external": "./lib/zip-fs-external.js",
|
|
7
7
|
"./mime-types": "./lib/zip-mime-types.js",
|
|
8
8
|
"./lib/zip-core-external.js": "./lib/zip-core-external.js",
|
|
9
|
-
"./lib/zip-fs-core-external.js": "./lib/zip-fs-core-external.js"
|
|
9
|
+
"./lib/zip-fs-core-external.js": "./lib/zip-fs-core-external.js",
|
|
10
|
+
"./lib/zip-core-custom.js": "./lib/zip-core-custom.js",
|
|
11
|
+
"./worker": "./lib/core/web-worker-base.js",
|
|
12
|
+
"./lib/core/web-worker-base.js": "./lib/core/web-worker-base.js"
|
|
13
|
+
},
|
|
14
|
+
"publish": {
|
|
15
|
+
"exclude": [
|
|
16
|
+
"tests/",
|
|
17
|
+
"dist/",
|
|
18
|
+
"!dist/zip-web-worker.js",
|
|
19
|
+
"!dist/zip-module.wasm",
|
|
20
|
+
"*.cjs",
|
|
21
|
+
"index.d.cts",
|
|
22
|
+
"index.min.js",
|
|
23
|
+
"index-native.js",
|
|
24
|
+
"index-native.min.js",
|
|
25
|
+
"package.json",
|
|
26
|
+
"package-lock.json",
|
|
27
|
+
".npmignore",
|
|
28
|
+
"eslint.config.mjs",
|
|
29
|
+
"worker-message-property-names.js",
|
|
30
|
+
"lib/core/web-worker-inline-template.js",
|
|
31
|
+
"lib/core/web-worker-inline-template-native.js",
|
|
32
|
+
"lib/core/zlib-streams-inline-template.js",
|
|
33
|
+
"lib/core/web-worker-inline-base.js"
|
|
34
|
+
]
|
|
10
35
|
},
|
|
11
36
|
"lint": {
|
|
12
37
|
"exclude": [
|
|
13
38
|
"dist/*.js",
|
|
14
39
|
"*-inline.js",
|
|
40
|
+
"lib/core/web-worker-inline-wasm.js",
|
|
41
|
+
"lib/core/web-worker-inline-native.js",
|
|
42
|
+
"lib/core/zlib-streams-inline.js",
|
|
15
43
|
"tests/",
|
|
16
44
|
"benchmarks/",
|
|
17
45
|
"**/*.cjs",
|
|
@@ -22,6 +50,8 @@
|
|
|
22
50
|
"rollup*",
|
|
23
51
|
"reserved-property-names.js",
|
|
24
52
|
"mangled-property-names.js",
|
|
53
|
+
"mime-types.json",
|
|
54
|
+
"generate-mime-type-data.js",
|
|
25
55
|
"tsconfig.json",
|
|
26
56
|
".vscode",
|
|
27
57
|
".eslintrc.json",
|