node-stream-zip 1.13.3 → 1.14.0
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 +4 -1
- package/node_stream_zip.d.ts +17 -17
- package/node_stream_zip.js +2 -2
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -214,7 +214,10 @@ npm test
|
|
|
214
214
|
## Known issues
|
|
215
215
|
|
|
216
216
|
- [utf8](https://github.com/rubyzip/rubyzip/wiki/Files-with-non-ascii-filenames) file names
|
|
217
|
-
|
|
217
|
+
|
|
218
|
+
## Out of scope
|
|
219
|
+
|
|
220
|
+
- AES encrypted files: the library will throw an error if you try to open it
|
|
218
221
|
|
|
219
222
|
## Contributors
|
|
220
223
|
|
package/node_stream_zip.d.ts
CHANGED
|
@@ -121,29 +121,29 @@ declare namespace StreamZip {
|
|
|
121
121
|
*/
|
|
122
122
|
offset: number;
|
|
123
123
|
}
|
|
124
|
-
}
|
|
125
124
|
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
class StreamZipAsync {
|
|
126
|
+
constructor(config: StreamZipOptions);
|
|
128
127
|
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
entriesCount: Promise<number>;
|
|
129
|
+
comment: Promise<string>;
|
|
131
130
|
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
entry(name: string): Promise<ZipEntry | undefined>;
|
|
132
|
+
entries(): Promise<{ [name: string]: ZipEntry }>;
|
|
133
|
+
entryData(entry: string | ZipEntry): Promise<Buffer>;
|
|
134
|
+
stream(entry: string | ZipEntry): Promise<NodeJS.ReadableStream>;
|
|
135
|
+
extract(entry: string | ZipEntry | null, outPath: string): Promise<number | undefined>;
|
|
134
136
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
entryData(entry: string | ZipEntry): Promise<Buffer>;
|
|
138
|
-
stream(entry: string | ZipEntry): Promise<NodeJS.ReadableStream>;
|
|
139
|
-
extract(entry: string | ZipEntry | null, outPath: string): Promise<number | undefined>;
|
|
137
|
+
on(event: 'entry', handler: (entry: ZipEntry) => void): void;
|
|
138
|
+
on(event: 'extract', handler: (entry: ZipEntry, outPath: string) => void): void;
|
|
140
139
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
close(): Promise<void>;
|
|
140
|
+
close(): Promise<void>;
|
|
141
|
+
}
|
|
145
142
|
}
|
|
146
143
|
|
|
144
|
+
type StreamZipOptions = StreamZip.StreamZipOptions;
|
|
145
|
+
type ZipEntry = StreamZip.ZipEntry;
|
|
146
|
+
|
|
147
147
|
declare class StreamZip {
|
|
148
148
|
constructor(config: StreamZipOptions);
|
|
149
149
|
|
|
@@ -187,7 +187,7 @@ declare class StreamZip {
|
|
|
187
187
|
|
|
188
188
|
close(callback?: (err?: any) => void): void;
|
|
189
189
|
|
|
190
|
-
static async: typeof StreamZipAsync;
|
|
190
|
+
static async: typeof StreamZip.StreamZipAsync;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
export = StreamZip;
|
package/node_stream_zip.js
CHANGED
|
@@ -533,7 +533,7 @@ const StreamZip = function (config) {
|
|
|
533
533
|
}
|
|
534
534
|
let dir = dirs.shift();
|
|
535
535
|
dir = path.join(baseDir, path.join(...dir));
|
|
536
|
-
fs.mkdir(dir, (err) => {
|
|
536
|
+
fs.mkdir(dir, { recursive: true }, (err) => {
|
|
537
537
|
if (err && err.code !== 'EEXIST') {
|
|
538
538
|
return callback(err);
|
|
539
539
|
}
|
|
@@ -678,7 +678,7 @@ StreamZip.async = class StreamZipAsync extends events.EventEmitter {
|
|
|
678
678
|
|
|
679
679
|
this[propZip] = new Promise((resolve, reject) => {
|
|
680
680
|
zip.on('ready', () => {
|
|
681
|
-
zip.
|
|
681
|
+
zip.removeListener('error', reject);
|
|
682
682
|
resolve(zip);
|
|
683
683
|
});
|
|
684
684
|
zip.on('error', reject);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-stream-zip",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "node.js library for reading and extraction of ZIP archives",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"zip",
|
|
@@ -39,5 +39,9 @@
|
|
|
39
39
|
"eslint": "^7.19.0",
|
|
40
40
|
"nodeunit": "^0.11.3",
|
|
41
41
|
"prettier": "^2.2.1"
|
|
42
|
+
},
|
|
43
|
+
"funding": {
|
|
44
|
+
"type": "github",
|
|
45
|
+
"url": "https://github.com/sponsors/antelle"
|
|
42
46
|
}
|
|
43
47
|
}
|