@zip.js/zip.js 2.8.51 → 2.8.53
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 +8 -3
- package/deno.json +1 -1
- package/dist/zip-core-external.js +241 -95
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +243 -94
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +564 -199
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +551 -194
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +564 -199
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +567 -198
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +567 -198
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +243 -94
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +243 -94
- package/dist/zip-native.min.js +1 -1
- package/dist/zip.js +243 -94
- package/dist/zip.min.js +1 -1
- package/eslint.config.mjs +1 -1
- package/index-native.cjs +567 -198
- package/index-native.min.js +1 -1
- package/index.cjs +567 -198
- package/index.d.cts +551 -45
- package/index.d.ts +551 -45
- package/index.min.js +1 -1
- package/lib/core/codec-worker-web.js +13 -4
- package/lib/core/codec-worker.js +2 -0
- package/lib/core/constants.js +9 -0
- package/lib/core/io.js +43 -4
- package/lib/core/options.js +2 -0
- package/lib/core/util/compatible-streams.js +3 -8
- package/lib/core/zip-entry.js +16 -0
- package/lib/core/zip-fs.js +236 -107
- package/lib/core/zip-reader.js +106 -40
- package/lib/core/zip-writer.js +171 -41
- package/lib/zip-core-writer.js +3 -0
- package/package.json +9 -7
package/README.md
CHANGED
|
@@ -174,15 +174,20 @@ Run the code on Plunker: https://plnkr.co/edit/4sVljNIpqSUE9HCA?preview
|
|
|
174
174
|
|
|
175
175
|
## Custom web workers and compression engines
|
|
176
176
|
|
|
177
|
-
zip.js
|
|
178
|
-
|
|
177
|
+
zip.js lets you create its web workers yourself by using the
|
|
178
|
+
`new Worker(new URL("./zip-worker.js", import.meta.url))` form. Bundlers like
|
|
179
|
+
Vite, webpack and Rollup detect it and bundle the worker automatically. You can
|
|
180
|
+
also delegate compression and decompression to a custom engine, e.g.
|
|
179
181
|
[fflate](https://github.com/101arrowz/fflate):
|
|
180
182
|
|
|
181
183
|
```js
|
|
182
184
|
import { configure } from "@zip.js/zip.js/lib/zip-core-custom.js";
|
|
183
185
|
|
|
184
186
|
configure({
|
|
185
|
-
createWorker: () => new Worker(
|
|
187
|
+
createWorker: () => new Worker(
|
|
188
|
+
new URL("./zip-worker.js", import.meta.url),
|
|
189
|
+
{ type: "module" }
|
|
190
|
+
)
|
|
186
191
|
});
|
|
187
192
|
```
|
|
188
193
|
|