@zip.js/zip.js 2.8.34 → 2.8.35

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 (52) hide show
  1. package/README.md +13 -1
  2. package/deno.json +5 -2
  3. package/dist/README.md +3 -1
  4. package/dist/zip-core.js +472 -220
  5. package/dist/zip-core.min.js +1 -1
  6. package/dist/zip-fs-core.js +449 -220
  7. package/dist/zip-fs-core.min.js +1 -1
  8. package/dist/zip-fs-native.js +476 -226
  9. package/dist/zip-fs-native.min.js +1 -1
  10. package/dist/zip-fs.js +478 -228
  11. package/dist/zip-fs.min.js +1 -1
  12. package/dist/zip-legacy.js +474 -222
  13. package/dist/zip-legacy.min.js +1 -1
  14. package/dist/zip-native.js +475 -223
  15. package/dist/zip-native.min.js +1 -1
  16. package/dist/zip-web-worker-native.js +1 -1
  17. package/dist/zip-web-worker.js +1 -1
  18. package/dist/zip.js +477 -225
  19. package/dist/zip.min.js +1 -1
  20. package/index-native.cjs +476 -226
  21. package/index-native.min.js +1 -1
  22. package/index.cjs +478 -228
  23. package/index.d.cts +53 -0
  24. package/index.d.ts +53 -0
  25. package/index.min.js +1 -1
  26. package/lib/core/codec-pool.js +2 -2
  27. package/lib/core/codec-worker.js +6 -2
  28. package/lib/core/configuration.js +22 -1
  29. package/lib/core/io.js +209 -56
  30. package/lib/core/streams/aes-crypto-stream.js +1 -10
  31. package/lib/core/streams/codec-stream.js +36 -15
  32. package/lib/core/streams/zip-entry-stream.js +19 -28
  33. package/lib/core/util/array.js +48 -0
  34. package/lib/core/web-worker-base.js +3 -3
  35. package/lib/core/web-worker-inline-native.js +1 -1
  36. package/lib/core/web-worker-inline-wasm.js +1 -1
  37. package/lib/core/zip-fs.js +2 -3
  38. package/lib/core/zip-reader.js +37 -40
  39. package/lib/core/zip-writer.js +58 -51
  40. package/lib/core/zlib-streams-inline.js +1 -1
  41. package/lib/zip-core-base.js +5 -3
  42. package/lib/zip-fs-native.js +2 -2
  43. package/lib/zip-fs-wasm.js +2 -2
  44. package/lib/zip-legacy.js +2 -2
  45. package/lib/zip-module-native.js +2 -2
  46. package/lib/zip-module-wasm.js +3 -3
  47. package/lib/zip-native.js +2 -2
  48. package/lib/zip-wasm.js +2 -2
  49. package/package.json +3 -3
  50. package/worker-message-property-names.js +3 -0
  51. package/.github/workflows/publish.yml +0 -30
  52. package/reserved-property-names.js +0 -50
package/README.md CHANGED
@@ -4,7 +4,7 @@ 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
6
  compression streams, archives larger than 4GB with Zip64, split zip files, data
7
- encryption, and Deflate64 decompression.
7
+ encryption, incremental writing, and Deflate64 decompression.
8
8
 
9
9
  # Demo
10
10
 
@@ -14,6 +14,18 @@ See https://gildas-lormeau.github.io/zip-manager
14
14
 
15
15
  See here for more info: https://gildas-lormeau.github.io/zip.js/
16
16
 
17
+ # Bundle size
18
+
19
+ zip.js is tree-shakeable: import named identifiers and your bundler removes what you do
20
+ not use, e.g. the whole write path if you only read zip files. `import * as zip from
21
+ "@zip.js/zip.js"` keeps everything.
22
+
23
+ Smaller entry points are also available, e.g. `@zip.js/zip.js/lib/zip-core.js` embeds
24
+ neither the Web Worker code nor the WASM module, pass `workerURI` and `wasmURI` to
25
+ `configure()` instead. The prebuilt bundles in
26
+ [`/dist`](https://github.com/gildas-lormeau/zip.js/tree/master/dist) are standalone files
27
+ for script tags and AMD loaders, they are not tree-shaken.
28
+
17
29
  # Examples
18
30
 
19
31
  ## Hello world
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zip-js/zip-js",
3
- "version": "2.8.34",
3
+ "version": "2.8.35",
4
4
  "exports": {
5
5
  ".": "./index.js"
6
6
  },
@@ -16,10 +16,13 @@
16
16
  },
17
17
  "exclude": [
18
18
  "rollup*",
19
+ "reserved-property-names.js",
20
+ "mangled-property-names.js",
19
21
  "tsconfig.json",
20
22
  ".vscode",
21
23
  ".eslintrc.json",
22
24
  "benchmarks",
23
- "docs"
25
+ "docs",
26
+ ".github"
24
27
  ]
25
28
  }
package/dist/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  **Note**: These bundles are not ES module compatible (you cannot `import` them directly). Use `index.js` at the project root or one of the `zip-*.js` files in [`/lib`](../lib) (e.g. `/lib/zip-core.js`) for ESM usage.
4
4
 
5
+ **Note**: These bundles are standalone and always contain both `ZipReader` and `ZipWriter`, they are not tree-shaken. With a bundler, importing named identifiers from `index.js` already removes the direction you do not use.
6
+
5
7
  Contents:
6
8
 
7
9
  - `zip.js` / `zip.min.js`: Full `ZipWriter` / `ZipReader` bundles with embedded Web Worker code and WASM.
@@ -14,5 +16,5 @@ Online builder:
14
16
  Alternatively, you can build your own version of zip.js with the online builder, see https://gildas-lormeau.github.io/zip.js/builder.
15
17
 
16
18
  Notes:
17
- - Files suffixed with `-native` rely on a pure JavaScript implementation of Compression Streams instead of a WASM module.
19
+ - Every bundle uses the native `CompressionStream`/`DecompressionStream` APIs when the environment supports them. What differs is the implementation embedded for everything else, i.e. custom compression levels, Deflate64 decompression, and environments lacking these APIs: a WASM module by default, or a pure JavaScript implementation of the Compression Streams API in the files suffixed with `-native`. The suffix names that implementation, it does not mean that these bundles rely more on the native APIs than the others.
18
20
  - `zip-legacy.min.js` is the equivalent of `zip.min.js` before the version `2.8`, it relies on a JavaScript implementation of Compression Streams (if used) but only in web workers. Alternatively `zip-native.min.js` includes the Compression Streams implementation in the main environment and the web workers.