Gathering detailed insights and metrics for zip-dir
Gathering detailed insights and metrics for zip-dir
Gathering detailed insights and metrics for zip-dir
Gathering detailed insights and metrics for zip-dir
npm install zip-dir
Typescript
Module System
Node Version
NPM Version
95.9
Supply Chain
85.7
Quality
74.3
Maintenance
100
Vulnerability
98.6
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
47 Stars
26 Commits
13 Forks
3 Watchers
8 Branches
5 Contributors
Updated on Jan 14, 2023
Latest Version
2.0.0
Package Id
zip-dir@2.0.0
Size
4.55 kB
NPM Version
6.14.8
Node Version
14.11.0
Published on
Nov 24, 2020
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Zips up a directory and saves the zip to disk or returns as a buffer.
$ npm install zip-dir
1var zipdir = require('zip-dir'); 2 3// `buffer` is the buffer of the zipped file 4var buffer = await zipdir('/path/to/be/zipped'); 5 6zipdir('/path/to/be/zipped', function (err, buffer) { 7 // `buffer` is the buffer of the zipped file 8}); 9 10zipdir('/path/to/be/zipped', { saveTo: '~/myzip.zip' }, function (err, buffer) { 11 // `buffer` is the buffer of the zipped file 12 // And the buffer was saved to `~/myzip.zip` 13}); 14 15// Use a filter option to prevent zipping other zip files! 16// Keep in mind you have to allow a directory to descend into! 17zipdir('/path/to/be/zipped', { filter: (path, stat) => !/\.zip$/.test(path) }, function (err, buffer) { 18 19}); 20 21// Use an `each` option to call a function everytime a file is added, and receives the path 22zipdir('/path/to/be/zipped', { each: path => console.log(p, "added!"), function (err, buffer) { 23 24}); 25
var zipdir = require('zip-dir');
Zips up dirPath
recursively preserving directory structure and returns
the compressed buffer on success. If the callback
function is supplied, it will be called with (error, buffer)
once the zipdir
function is done. If not, the buffer or an error can be obtained from the returned promise. The callback
and the promise are mutually exclusive. If options
defined with a saveTo
path, then the callback and promise will be delayed until the buffer has also
been saved to disk.
saveTo
A path to save the buffer to.filter
A function that is called for all items to determine whether or not they should be added to the zip buffer. Function is called with the fullPath
and a stats
object (fs.Stats). Return true to add the item; false otherwise. To include files within directories, directories must also pass this filter.each
A function that is called everytime a file or directory is added to the zip.MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 3/25 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
security policy file not detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
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
Reason
15 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
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