Gathering detailed insights and metrics for adm-zip
Gathering detailed insights and metrics for adm-zip
Gathering detailed insights and metrics for adm-zip
Gathering detailed insights and metrics for adm-zip
A Javascript implementation of zip for nodejs. Allows user to create or extract zip files both in memory or to/from disk
npm install adm-zip
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
2,056 Stars
455 Commits
375 Forks
40 Watching
3 Branches
89 Contributors
Updated on 27 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-5.5%
1,041,930
Compared to previous day
Last week
2%
5,953,081
Compared to previous week
Last month
6%
24,938,297
Compared to previous month
Last year
22.8%
241,432,167
Compared to previous year
5
ADM-ZIP is a pure JavaScript implementation for zip data compression for NodeJS.
With npm do:
$ npm install adm-zip
Electron file system support described below.
The library allows you to:
There are no other nodeJS libraries that ADM-ZIP is dependent of
1var AdmZip = require("adm-zip"); 2 3// reading archives 4var zip = new AdmZip("./my_file.zip"); 5var password = "1234567890"; 6var zipEntries = zip.getEntries(); // an array of ZipEntry records - add password parameter if entries are password protected 7 8zipEntries.forEach(function (zipEntry) { 9 console.log(zipEntry.toString()); // outputs zip entries information 10 if (zipEntry.entryName == "my_file.txt") { 11 console.log(zipEntry.getData().toString("utf8")); 12 } 13}); 14// outputs the content of some_folder/my_file.txt 15console.log(zip.readAsText("some_folder/my_file.txt")); 16// extracts the specified file to the specified location 17zip.extractEntryTo(/*entry name*/ "some_folder/my_file.txt", /*target path*/ "/home/me/tempfolder", /*maintainEntryPath*/ false, /*overwrite*/ true); 18// extracts everything 19zip.extractAllTo(/*target path*/ "/home/me/zipcontent/", /*overwrite*/ true); 20 21// creating archives 22var zip = new AdmZip(); 23 24// add file directly 25var content = "inner content of the file"; 26zip.addFile("test.txt", Buffer.from(content, "utf8"), "entry comment goes here"); 27// add local file 28zip.addLocalFile("/home/me/some_picture.png"); 29// get everything as a buffer 30var willSendthis = zip.toBuffer(); 31// or write everything to disk 32zip.writeZip(/*target file name*/ "/home/me/files.zip"); 33 34// ... more examples in the wiki
For more detailed information please check out the wiki.
ADM-ZIP has supported electron original-fs for years without any user interractions but it causes problem with bundlers like rollup etc. For continuing support original-fs or any other custom file system module. There is possible specify your module by fs option in ADM-ZIP constructor.
Example:
1const AdmZip = require("adm-zip"); 2const OriginalFs = require("original-fs"); 3 4// reading archives 5const zip = new AdmZip("./my_file.zip", { fs: OriginalFs }); 6. 7. 8.
The latest stable version of the package.
Stable Version
1
5.5/10
Summary
Arbitrary File Write in adm-zip
Affected Versions
< 0.4.11
Patched Versions
0.4.11
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
SAST tool detected but not run on all commits
Details
Reason
6 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 5
Reason
Found 6/19 approved changesets -- score normalized to 3
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
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
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-11-25
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