extract-zip

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

  • 所有者: max-mapper/extract-zip
  • 平台: Linux, Mac, Windows
  • 许可证: BSD 2-Clause "Simplified" License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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()。

主要指标

概览
名称与所有者max-mapper/extract-zip
主编程语言JavaScript
编程语言JavaScript (语言数: 2)
平台Linux, Mac, Windows
许可证BSD 2-Clause "Simplified" License
所有者活动
创建于2014-10-17 07:13:20
推送于2022-02-06 19:05:05
最后一次提交2021-08-01 15:13:25
发布数20
最新版本名称v2.0.1 (发布于 2020-06-10 00:07:20)
第一版名称v1.1.0 (发布于 2015-09-15 21:45:39)
用户参与
星数395
关注者数5
派生数128
提交数97
已启用问题?
问题数85
打开的问题数40
拉请求数25
打开的拉请求数12
关闭的拉请求数23
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?

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().