extract-zip

用纯 JavaScript 编写的 Zip 提取。将 zip 解压缩到目录中。(Zip extraction written in pure JavaScript. Extracts a zip into a directory.)

  • Owner: max-mapper/extract-zip
  • Platform: Linux, Mac, Windows
  • License:: BSD 2-Clause "Simplified" License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

extract-zip

解压缩用纯 JavaScript 编写。 将 zip 提取到目录中。 可用作库或命令行程序。

使用 yauzl ZIP 解析器。

安装

获取库:

npm install extract-zip --save

安装命令行程序:

npm install extract-zip -g

JS API

var extract = require('extract-zip')
extract(source, {dir: target}, function (err) {
  //提取完成。 确保处理错误
})

选项

  • dir - 默认为 process.cwd()
  • defaultDirMode —— 整数 - 目录模式(权限)默认为493(八进制0755整数)
  • defaultFileMode —— 整数 - 文件模式(权限)默认为420(八进制0644整数)
  • onEntry —— 函数 - 如果存在,将使用(entry,zipfile)调用,entry 是从yauzl 的 entry 事件转发的zip文件中的每个条目。 zipfile 是 yauzl 实例

仅当 zip 文件中未设置权限时才使用默认模式。

CLI 用法

extract-zip foo.zip

如果未指定,targetDirectory 将默认为 process.cwd()。

Overview

Name With Ownermax-mapper/extract-zip
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 2)
PlatformLinux, Mac, Windows
License:BSD 2-Clause "Simplified" License
Release Count20
Last Release Namev2.0.1 (Posted on 2020-06-10 00:07:20)
First Release Namev1.1.0 (Posted on 2015-09-15 21:45:39)
Created At2014-10-17 07:13:20
Pushed At2022-02-06 19:05:05
Last Commit At2021-08-01 15:13:25
Stargazers Count386
Watchers Count5
Fork Count125
Commits Count97
Has Issues Enabled
Issues Count83
Issue Open Count38
Pull Requests Count25
Pull Requests Open Count10
Pull Requests Close Count23
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

extract-zip

Unzip written in pure JavaScript. Extracts a zip into a directory. Available as a library or a command line program.

Uses the yauzl ZIP parser.

NPM
js-standard-style
Build Status

Installation

Get the library:

npm install extract-zip --save

Install the command line program:

npm install extract-zip -g

JS API

var extract = require('extract-zip')
extract(source, {dir: target}, function (err) {
 // extraction is complete. make sure to handle the err
})

Options

  • dir - defaults to process.cwd()
  • defaultDirMode - integer - Directory Mode (permissions) will default to 493 (octal 0755 in integer)
  • defaultFileMode - integer - File Mode (permissions) will default to 420 (octal 0644 in integer)
  • onEntry - function - if present, will be called with (entry, zipfile), entry is every entry from the zip file forwarded from the entry event from yauzl. zipfile is the yauzl instance

Default modes are only used if no permissions are set in the zip file.

CLI Usage

extract-zip foo.zip <targetDirectory>

If not specified, targetDirectory will default to process.cwd().

To the top