@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.
Files changed (41) hide show
  1. package/README.md +8 -3
  2. package/deno.json +1 -1
  3. package/dist/zip-core-external.js +241 -95
  4. package/dist/zip-core-external.min.js +1 -1
  5. package/dist/zip-core.js +243 -94
  6. package/dist/zip-core.min.js +1 -1
  7. package/dist/zip-fs-core-external.js +564 -199
  8. package/dist/zip-fs-core-external.min.js +1 -1
  9. package/dist/zip-fs-core.js +551 -194
  10. package/dist/zip-fs-core.min.js +1 -1
  11. package/dist/zip-fs-external.js +564 -199
  12. package/dist/zip-fs-external.min.js +1 -1
  13. package/dist/zip-fs-native.js +567 -198
  14. package/dist/zip-fs-native.min.js +1 -1
  15. package/dist/zip-fs.js +567 -198
  16. package/dist/zip-fs.min.js +1 -1
  17. package/dist/zip-legacy.js +243 -94
  18. package/dist/zip-legacy.min.js +1 -1
  19. package/dist/zip-native.js +243 -94
  20. package/dist/zip-native.min.js +1 -1
  21. package/dist/zip.js +243 -94
  22. package/dist/zip.min.js +1 -1
  23. package/eslint.config.mjs +1 -1
  24. package/index-native.cjs +567 -198
  25. package/index-native.min.js +1 -1
  26. package/index.cjs +567 -198
  27. package/index.d.cts +551 -45
  28. package/index.d.ts +551 -45
  29. package/index.min.js +1 -1
  30. package/lib/core/codec-worker-web.js +13 -4
  31. package/lib/core/codec-worker.js +2 -0
  32. package/lib/core/constants.js +9 -0
  33. package/lib/core/io.js +43 -4
  34. package/lib/core/options.js +2 -0
  35. package/lib/core/util/compatible-streams.js +3 -8
  36. package/lib/core/zip-entry.js +16 -0
  37. package/lib/core/zip-fs.js +236 -107
  38. package/lib/core/zip-reader.js +106 -40
  39. package/lib/core/zip-writer.js +171 -41
  40. package/lib/zip-core-writer.js +3 -0
  41. 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 can create its web workers with the standard bundler pattern and
178
- delegate compression/decompression to a custom engine, e.g.
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(new URL("./zip-worker.js", import.meta.url), { type: "module" })
187
+ createWorker: () => new Worker(
188
+ new URL("./zip-worker.js", import.meta.url),
189
+ { type: "module" }
190
+ )
186
191
  });
187
192
  ```
188
193
 
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zip-js/zip-js",
3
- "version": "2.8.51",
3
+ "version": "2.8.53",
4
4
  "exports": {
5
5
  ".": "./index.js",
6
6
  "./external": "./lib/zip-fs-external.js",