bestzip 4.0.3 → 4.0.4
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/lib/nodezip.js +7 -11
- package/package.json +1 -1
package/lib/nodezip.js
CHANGED
|
@@ -21,22 +21,18 @@ export async function nodeZip(options) {
|
|
|
21
21
|
zlib: { level: options.level },
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
output.on("close", async () => {
|
|
25
|
-
await outputFile.close();
|
|
26
|
-
resolvePromise();
|
|
27
|
-
});
|
|
28
|
-
archive.on("error", (err) => rejectPromise(err));
|
|
29
|
-
archive.on("warning", (err) => console.warn(err && err.message));
|
|
30
|
-
|
|
31
|
-
archive.pipe(output);
|
|
32
|
-
|
|
33
|
-
let resolvePromise;
|
|
34
24
|
let rejectPromise;
|
|
35
25
|
const promise = new Promise((resolve, reject) => {
|
|
36
|
-
resolvePromise = resolve;
|
|
37
26
|
rejectPromise = reject;
|
|
27
|
+
output.on("close", resolve);
|
|
28
|
+
// output (createWriteStream) closing automatically closes outputFile
|
|
29
|
+
archive.on("error", reject);
|
|
38
30
|
});
|
|
39
31
|
|
|
32
|
+
archive.on("warning", (err) => console.warn(err && err.message));
|
|
33
|
+
|
|
34
|
+
archive.pipe(output);
|
|
35
|
+
|
|
40
36
|
async function addSource(source) {
|
|
41
37
|
const fullPath = path.resolve(cwd, source);
|
|
42
38
|
const destPath = source;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bestzip",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"description": "Uses OS zip command if available (for better performance and speed) or node.js version if there is no system command available. Can be called via node or command line.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./lib/bestzip.js",
|