sftp-zip-deploy 0.0.7 → 0.0.8
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/dist/utils.js +8 -2
- package/package.json +1 -1
package/dist/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createZipArchive, ZipEntry } from 'node:zlib';
|
|
1
|
+
import { createZipArchive, ZipEntry, createGzip, constants } from 'node:zlib';
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
3
|
import { createWriteStream } from 'node:fs';
|
|
4
4
|
import { pipeline } from 'node:stream/promises';
|
|
@@ -33,7 +33,13 @@ export async function zipFiles(dir, files, zipPath) {
|
|
|
33
33
|
}
|
|
34
34
|
const archive = createZipArchive(entries);
|
|
35
35
|
const ws = createWriteStream(zipPath);
|
|
36
|
-
|
|
36
|
+
const maxCompressionOptions = {
|
|
37
|
+
level: constants.Z_BEST_COMPRESSION, // 9 (default is 6)
|
|
38
|
+
windowBits: 15, // Max 32KB history window (default is 15)
|
|
39
|
+
memLevel: 9, // Max internal hash table memory (default is 8)
|
|
40
|
+
strategy: constants.Z_DEFAULT_STRATEGY,
|
|
41
|
+
};
|
|
42
|
+
await pipeline(archive, createGzip(maxCompressionOptions), ws);
|
|
37
43
|
return ws.bytesWritten;
|
|
38
44
|
}
|
|
39
45
|
/**
|