Skip to content

Commit ef97108

Browse files
committed
Merge branch no-zip64 (updated dev dependencies and README)
2 parents 5985629 + aa961da commit ef97108

4 files changed

Lines changed: 517 additions & 90 deletions

File tree

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.5.0:
2+
3+
* new: `mode` field in input objects can override the default POSIX file mode.
4+
15
## 2.4.6:
26

37
* bugfix: the `filename` attribute in a Content-Disposition header is now parsed correctly

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
`client-zip` concatenates multiple files (e.g. from multiple HTTP requests) into a single ZIP, **in the browser**, so you can let your users download all the files in one click. It does *not* compress the files or unzip existing archives.
99

10-
`client-zip` is lightweight (6.3 kB minified, 2.6 kB gzipped), dependency-free, and 40 times faster than the old JSZip.
10+
`client-zip` is lightweight (6.4 kB minified, 2.6 kB gzipped), dependency-free, and 40 times faster than the old JSZip.
1111

1212
* [Quick Start](#Quick-Start)
1313
* [Compatibility](#Compatibility)
@@ -75,6 +75,7 @@ function predictLength(metadata: Iterable<MetadataTypes>): bigint
7575
- `name`: the file name ; optional if your input is a File or a Response because they have relevant metadata
7676
- `lastModified`: last modification date of the file (defaults to `new Date()` unless the input is a File or Response with a valid "Last-Modified" header)
7777
- `input`: something that contains your data; it can be a `File`, a `Blob`, a `Response`, some kind of `ArrayView` or a raw `ArrayBuffer`, a `ReadableStream<Uint8Array>` (yes, only Uint8Arrays, but most APIs give you just that type anyway), an `AsyncIterable<ArrayBuffer | ArrayView | string>`, … or just a string.
78+
- `mode`: override the POSIX file mode (by default, it will be `0o664`). Should be between `0` and `0o777`disrespect that constraint at your own risk.
7879

7980
The *options* argument currently supports three properties, `length`, `metadata` (see [Content-Length prediction](#content-length-prediction)) and `buffersAreUTF8` (see [Filename encoding](#filename-encoding)).
8081

@@ -156,9 +157,9 @@ In a different experiment using Deno to avoid storing very large output files, m
156157

157158
Now, comparing bundle size is clearly unfair because the others do a bunch of things that my library doesn't. Here you go anyway (sizes are shown in decimal kilobytes):
158159

159-
| | `client-zip`@2.4.6 | fflate@0.7.4 | zip.js@2.7.14 | conflux@4.0.3 | JSZip@3.10.1 |
160+
| | `client-zip`@2.5.0 | fflate@0.7.4 | zip.js@2.7.14 | conflux@4.0.3 | JSZip@3.10.1 |
160161
|--------------------|-------------------:|-------------:|--------------:|--------------:|--------------:|
161-
| minified | 6.3kB | 29.8kB | 163.2kB | 198.8kB | 94.9kB |
162+
| minified | 6.4kB | 29.8kB | 163.2kB | 198.8kB | 94.9kB |
162163
| minified + gzipped | 2.6kB | 11kB | 58kB | 56.6kB | 27.6kB |
163164

164165
The datasets I used in the new tests are not public domain, but nothing sensitive either ; I can send them if you ask.
@@ -183,7 +184,9 @@ If you need a feature, you're very welcome to [open an issue](https://github.com
183184

184185
Should be straightforward to implement if needed. Maybe `client-zip` should allow extending by third-party code so those extra fields can be plug-ins instead of built into the library.
185186

186-
<del>The UNIX permissions in external attributes (ignored by many readers, though) are hardcoded to 664, could be made configurable.</del> The UNIX permissions are now configurable via the `mode` field, set by default to 664 for files, 775 for folders.
187+
<del>Configurable UNIX permissions in external attributes.</del> The UNIX permissions are now configurable (since 1.7.0) via the `mode` field, set by default to 664 for files, 775 for folders.
188+
189+
### ZIP64
187190

188191
### <del>ZIP64</del>
189192

0 commit comments

Comments
 (0)