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
發布數20
最新版本名稱v2.0.1 (發布於 2020-06-10 00:07:20)
第一版名稱v1.1.0 (發布於 2015-09-15 21:45:39)
創建於2014-10-17 07:13:20
推送於2022-02-06 19:05:05
最后一次提交2021-08-01 15:13:25
星數386
關注者數5
派生數125
提交數97
已啟用問題?
問題數83
打開的問題數38
拉請求數25
打開的拉請求數10
關閉的拉請求數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().

去到頂部