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

7z-extract

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

7z-extract

7z wrapper with progress (promises/es6)

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by25%
Maintainers
1
Weekly downloads
 
Created
Source

7z-extract

Build Status

Wrapper for 7zip which attempts to provide an extraction status (something the 7z command doesn't really do).

Prerequisites

The 7z command is required and needs to be in PATH or the root of your application i.e. where package.json is sitting.

# OSX
$ brew update && brew doctor && brew install p7zip
# Ubuntu
$ sudo apt-get install p7zip-full

Install

npm install 7z-extract --save

API

const archive = new Zip(options);
  • input String - The input file path
  • output String - The output path (optional, if not supplied uses /tmp)
  • createFolder Boolean - Creates a random folder name to extract to the files to. (default false)
archive.list(); //- returns a promise, the result of which is an object including array of files in the archive
archive.extract(progress); //- extracts the archive and returns a promise, progress function optionally returns current status as object (index, totalNumberOfFiles, percentage)

Usage

To see info on a CBZ file.

'use strict';

const path = require('path'),
    Zip = require('../index'),
    inputFile = path.join(__dirname, 'archive.zip'),
    outputPath = path.join(__dirname), // optional, if not supplied uses /tmp
    progress = info => {
        console.log(info);
    };

const archive = new Zip({ input: inputFile, output: outputPath, createFolder: true });

  // archive.list()
  //  .then(res => { if (res){ console.log('Success!', res); } })
  //  .catch(err => { console.error(err); });

archive.extract(progress)
    .then(res => { console.log('Success!', res); })
    .catch(err => { console.error(err); });

Keywords

FAQs

Package last updated on 13 Jul 2016

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