Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-7z

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-7z

A Node.js wrapper for 7-Zip

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10K
increased by3.02%
Maintainers
1
Weekly downloads
 
Created
Source

node-7z

Dependencies Status Build Status Code coverage Code quality Release

A Node.js wrapper for 7-Zip

Usage

I chose to use Promises in this library. API is consistent with standard use:

var Zip = require('7z'); // Name the class as you want!
var myTask = new Zip();
myTask.extractFull('myArchive.7z', 'destination', { p: 'myPassword' })

// Equivalent to `on('data', function (files) { // ... });`
.progress(function (files) {
  console.log('Some files are extracted: %s', files);
});

// When all is done
.then(function () {
  console.log('Extracting done!');
});

// On error
.catch(function (err, code) {
  console.error('7-Zip exit with code %i', code);
  console.error(err);
});

Installation

You must have the 7z executable available in your PATH. In some GNU/Linux distributions install the p7zip-full.

npm install --save 7z

API

Extract: Zip.extract

Arguments

  • archive The path to the archive you want to analyse.
  • dest Where to extract the archive.
  • options An object of options.

Progress

  • files A array of all the extracted files AND directories. The / character is used as a path separator on every platform.

Error

  • err An Error object.

Extract with full paths: Zip.extractFull

Arguments

  • archive The path to the archive you want to analyse.
  • dest Where to extract the archive.
  • options An object of options.

Progress

  • files A array of all the extracted files AND directories. The / character is used as a path separator on every platform.

Error

  • err An Error object.

Test integrity of archive: Zip.test

Arguments

  • archive The path to the archive you want to analyse.
  • options An object of options.

Progress

  • files A array of all the extracted files AND directories. The / character is used as a path separator on every platform.

Error

  • err An Error object.

List contents of archive: Zip.list

Arguments

  • archive The path to the archive you want to analyse.
  • options An object of options.

Progress

  • files A array of all the extracted files AND directories. The / character is used as a path separator on every platform.

Fulfill

  • spec An object of tech spec about the archive. Properties are: date, attr, size and name.

Error

  • err An Error object.

With :heart: from quentinrossetti

Keywords

FAQs

Package last updated on 25 Aug 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc