Gathering detailed insights and metrics for 7zip-min
Gathering detailed insights and metrics for 7zip-min
npm install 7zip-min
Typescript
Module System
Node Version
NPM Version
83.6
Supply Chain
100
Quality
80.3
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
1,012,491
Last Day
1,368
Last Week
6,899
Last Month
36,250
Last Year
411,956
MIT License
43 Stars
194 Commits
16 Forks
4 Watchers
1 Branches
5 Contributors
Updated on Feb 22, 2025
Minified
Minified + Gzipped
Latest Version
2.0.0
Package Id
7zip-min@2.0.0
Unpacked Size
15.27 kB
Size
5.00 kB
File Count
5
NPM Version
10.8.2
Node Version
20.18.0
Published on
Jan 23, 2025
Cumulative downloads
Total Downloads
Last Day
15.1%
1,368
Compared to previous day
Last Week
-5.8%
6,899
Compared to previous week
Last Month
-26.5%
36,250
Compared to previous month
Last Year
79.7%
411,956
Compared to previous year
1
Minimal cross-platform pack/unpack (and any command) with 7-zip for Node.js.
It does not require 7zip to be installed in your system.
This package includes a standalone 7za version of 7-Zip (uses precompiled binaries from 7zip-bin package).
According to Command Line Version User's Guide page, 7za supports only 7z, lzma, cab, zip, gzip, bzip2, Z and tar formats.
To get more details, check 7zip-bin package repo.
Package should work with Electron.
You will have to unpack the binary (asarUnpack
option if you use electron-builder
.)
You may use pack
and unpack
methods for simple packing/unpacking.
You can also use list
to get an array with the file content properties (includes date, time, attr, size, compressed, and name)
Or use cmd
to run 7za with custom parameters (see Command Line Version User's Guide)
You can use package with callbacks and in async way (with promises).
1const _7z = require('7zip-min'); 2 3// ....... 4await _7z.pack('path/to/dir/or/file', 'path/to/archive.7z'); 5await _7z.unpack('path/to/archive.7z', 'where/to/unpack'); 6const list = await _7z.list('path/to/archive.7z'); // list of items inside archive 7const output = await _7z.cmd(['a', 'path/to/archive.7z', 'path/to/dir/or/file']); // run custom command
1// unpack with callback 2_7z.unpack('path/to/archive.7z', 'where/to/unpack', (err, output) => { 3 if (err) { 4 console.error('Error', err.message); 5 } else { 6 // everything is Ok 7 console.log('stdout of the 7za command execution', output); // output just in case you need it 8 } 9}); 10 11// unpack with promise 12_7z.unpack('path/to/archive.7z', 'where/to/unpack') 13 .then(output => console.log('stdout of the 7za command execution', output)) 14 .catch(err => console.error('Error', err.message)); 15 16// unpack with async/await 17(async () => { 18 try { 19 const output = await _7z.unpack('path/to/archive.7z', 'where/to/unpack'); 20 console.log('stdout of the 7za command execution', output); 21 } catch (err) { 22 console.error('Error', err.message); 23 } 24})(); 25 26// if no output directroy specified, it will unpack into the current directory (process.cwd()) 27_7z.unpack('path/to/archive.7z') 28 .then(output => console.log('stdout of the 7za command execution', output)) 29 .catch(err => console.error('Error', err.message));
1// pack with callback 2_7z.pack('path/to/dir/or/file', 'path/to/archive.7z', (err, output) => { 3 if (err) { 4 console.error('Error', err.message); 5 } else { 6 // everything is Ok 7 console.log('stdout of the 7za command execution', output); 8 } 9}); 10 11// pack with promise 12_7z.pack('path/to/dir/or/file', 'path/to/archive.7z') 13 .then(output => console.log('stdout of the 7za command execution', output)) 14 .catch(err => console.error('Error', err.message)); 15 16// pack with async/await 17(async () => { 18 try { 19 const output = await _7z.pack('path/to/dir/or/file', 'path/to/archive.7z'); 20 console.log('stdout of the 7za command execution', output); 21 } catch (err) { 22 console.error('Error', err.message); 23 } 24})();
1// list with callback 2_7z.list('path/to/archive.7z', (err, list) => { 3 if (err) { 4 console.error('Error', err.message); 5 } else { 6 console.log('List of items inside the archive', list); 7 // For each element in the archive you will have: 8 // name, date, time, attr, size (in bytes), compressed (compressed size in bytes), crc, method, encrypted, block 9 // Depending on the archive type some values may be empty or missed 10 } 11}); 12 13// list with promise 14_7z.list('path/to/archive.7z') 15 .then(list => console.log('List of items inside the archive', list)) 16 .catch(err => console.error('Error', err.message)); 17 18// list with async/await 19(async () => { 20 try { 21 const list = await _7z.list('path/to/archive.7z'); 22 console.log('List of items inside the archive', list); 23 } catch (err) { 24 console.error('Error', err.message); 25 } 26})();
1// cmd with callback 2// in the first parameter you have to provide an array of parameters 3// check 7z's Command Line Version User's Guide - https://web.mit.edu/outland/arch/i386_rhel4/build/p7zip-current/DOCS/MANUAL/ 4// the bellow command is equal to `7za a path/to/archive.7z path/to/dir/or/file` and will add `path/to/dir/or/file` to `path/to/archive.7z` archive 5_7z.cmd(['a', 'path/to/archive.7z', 'path/to/dir/or/file'], (err, output) => { 6 if (err) { 7 console.error('Error', err.message); 8 } else { 9 // Execution finished succesfully 10 console.log('stdout of the 7za command execution', output); 11 } 12}); 13 14// cmd with promise 15_7z.cmd(['a', 'path/to/archive.7z', 'path/to/dir/or/file']) 16 .then(output => console.log('stdout of the 7za command execution', output)) 17 .catch(err => console.error('Error', err.message)); 18 19// cmd with async/await 20(async () => { 21 try { 22 const output = await _7z.cmd(['a', 'path/to/archive.7z', 'path/to/dir/or/file']); 23 console.log('stdout of the 7za command execution', output); 24 } catch (err) { 25 console.error('Error', err.message); 26 } 27})();
npm test
No vulnerabilities found.
Reason
25 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
Found 0/7 approved changesets -- 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
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