Gathering detailed insights and metrics for zip-a-folder
Gathering detailed insights and metrics for zip-a-folder
Gathering detailed insights and metrics for zip-a-folder
Gathering detailed insights and metrics for zip-a-folder
Forked the idea of @sole to zip a complete folder into a zip file but now using promises
npm install zip-a-folder
Typescript
Module System
Node Version
NPM Version
93.4
Supply Chain
98.5
Quality
79.6
Maintenance
100
Vulnerability
99.3
License
TypeScript (97.08%)
Shell (2.92%)
Total Downloads
23,961,200
Last Day
47,631
Last Week
200,667
Last Month
968,739
Last Year
8,411,640
74 Stars
75 Commits
12 Forks
2 Watchers
1 Branches
8 Contributors
Updated on Apr 25, 2025
Latest Version
3.1.9
Package Id
zip-a-folder@3.1.9
Unpacked Size
105.87 kB
Size
29.39 kB
File Count
12
NPM Version
10.9.2
Node Version
22.13.1
Published on
Mar 19, 2025
Cumulative downloads
Total Downloads
Last Day
166.6%
47,631
Compared to previous day
Last Week
11.4%
200,667
Compared to previous week
Last Month
17.5%
968,739
Compared to previous month
Last Year
60.9%
8,411,640
Compared to previous year
Easy to use zip (or tar) a complete folder or a list of globs plain into a zip/tar/tgz file including compression ratio handling and custom write streams.
Install via npm
npm install zip-a-folder
1import { zip } from 'zip-a-folder'; 2 3class TestMe { 4 5 static async main() { 6 await zip('/path/to/the/folder', '/path/to/archive.zip'); 7 } 8} 9 10TestMe.main();
1import { tar } from 'zip-a-folder'; 2 3class TestMe { 4 5 static async main() { 6 await tar('/path/to/the/folder', '/path/to/archive.tgz'); 7 } 8} 9 10TestMe.main();
For the sake of easy use, supported compression levels are (by now):
COMPRESSION_LEVEL.high
, COMPRESSION_LEVEL.medium
or COMPRESSION_LEVEL.uncompressed
.
The default compression - level is high
.
1import { zip, COMPRESSION_LEVEL } from 'zip-a-folder'; 2 3class TestMe { 4 5 static async main() { 6 await zip('/path/to/the/folder', '/path/to/archive.zip', {compression: COMPRESSION_LEVEL.high}); 7 } 8} 9 10TestMe.main();
You can now pipe output to any WriteStream (just pass WriteStream as a parameter).
To keep the existing api stable the 2nd parameter (targetFilePath) can now be either undefined or an empty string.
ATTENTION: customWriteStream
is not checked. So it is up to the user to check
on non-existing target folders or if the targetfolder equals to the sourcefolder
(ending up in circularity).
1import { zip, COMPRESSION_LEVEL } from 'zip-a-folder'; 2import { fs } from 'fs'; 3 4class TestMe { 5 static async main() { 6 const customWS = fs.createWriteStream('test/1234.zip'); 7 await zipafolder.zip(path.resolve(__dirname, 'data/'), undefined, {customWriteStream: customWS}); 8 } 9} 10 11TestMe.main();
The first parameter can be either a path or a glob. Globs are separated by comma.
1import {zip} from 'zip-a-folder'; 2 3class TestMe { 4 5 static async main() { 6 // zip all json into an archive 7 await zip('**/*.json', '/path/to/archive.zip'); 8 // zip all json AND txt files into a second archive 9 await zip('**/*.json, **/*.txt', '/path/to/archive2.zip'); 10 } 11} 12 13TestMe.main();
With passing a destination path to zip-a-folder options object you can define the target folder structure within the generated zip.
1import {zip} from 'zip-a-folder'; 2 3class TestMe { 4 5 static async main() { 6 // zip all json into an archive 7 await zip('data/', '/path/to/archive.zip', {destPath: 'data/'}); 8 } 9} 10 11TestMe.main();
Tests can be found in /test
and run by jest. To run the tests call npm test
.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 2/30 approved changesets -- score normalized to 0
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-04-28
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More