Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
The 7zip-bin npm package provides a way to use the 7-Zip compression tool within Node.js applications. It includes precompiled binaries for various platforms, allowing you to perform compression and decompression tasks without needing to install 7-Zip separately.
Compress files
This feature allows you to compress files into a 7z archive. The code sample demonstrates how to use the 7zip-bin package to compress 'file.txt' into 'archive.7z'.
const { execFile } = require('child_process');
const pathTo7zip = require('7zip-bin').path7za;
execFile(pathTo7zip, ['a', 'archive.7z', 'file.txt'], (err, stdout, stderr) => {
if (err) throw err;
console.log(stdout);
});
Decompress files
This feature allows you to decompress files from a 7z archive. The code sample demonstrates how to use the 7zip-bin package to extract 'archive.7z'.
const { execFile } = require('child_process');
const pathTo7zip = require('7zip-bin').path7za;
execFile(pathTo7zip, ['x', 'archive.7z'], (err, stdout, stderr) => {
if (err) throw err;
console.log(stdout);
});
List contents of an archive
This feature allows you to list the contents of a 7z archive. The code sample demonstrates how to use the 7zip-bin package to list the contents of 'archive.7z'.
const { execFile } = require('child_process');
const pathTo7zip = require('7zip-bin').path7za;
execFile(pathTo7zip, ['l', 'archive.7z'], (err, stdout, stderr) => {
if (err) throw err;
console.log(stdout);
});
The node-7z package provides a similar interface for working with 7-Zip in Node.js. It offers more advanced features like progress tracking and event-based notifications. However, it requires 7-Zip to be installed separately on the system.
The decompress package is a general-purpose decompression library for Node.js. It supports multiple formats including .zip, .tar, .tar.gz, and .tar.bz2. Unlike 7zip-bin, it does not support the 7z format but is useful for handling other common archive types.
The adm-zip package is a pure JavaScript implementation for handling .zip files. It does not require any external binaries and is easy to use for basic zip file operations. However, it does not support the 7z format.
7-Zip precompiled binaries.
FAQs
7-Zip precompiled binaries
The npm package 7zip-bin receives a total of 161,187 weekly downloads. As such, 7zip-bin popularity was classified as popular.
We found that 7zip-bin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.