Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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 306,159 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.