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
94.1
Supply Chain
98.5
Quality
76.6
Maintenance
100
Vulnerability
99.3
License
TypeScript (97.08%)
Shell (2.92%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
22,311,110
Last Day
8,513
Last Week
151,238
Last Month
769,195
Last Year
7,515,334
73 Stars
74 Commits
12 Forks
2 Watchers
1 Branches
8 Contributors
Updated on Jan 20, 2025
Latest Version
3.1.8
Package Id
zip-a-folder@3.1.8
Unpacked Size
104.54 kB
Size
29.14 kB
File Count
12
NPM Version
10.9.0
Node Version
22.11.0
Published on
Nov 06, 2024
Cumulative downloads
Total Downloads
Last Day
-7.1%
8,513
Compared to previous day
Last Week
-20.3%
151,238
Compared to previous week
Last Month
-5.7%
769,195
Compared to previous month
Last Year
23.1%
7,515,334
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
2 existing vulnerabilities detected
Details
Reason
Found 2/30 approved changesets -- score normalized to 0
Reason
0 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
project is not fuzzed
Details
Reason
license file not detected
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-03-10
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