简体   繁体   中英

Unzip files with node.js on Windows

What options are there to handle unzipping .zip files from within a Node.js script on Windows (XP)?

I'm working with the latest (at present) node.js v0.5.8 Windows node.exe .

Suggestions welcome.

-P.

ADM-ZIP是用于NodeJS的zip数据压缩的纯JavaScript实现。

I've found this zip library . It's very easy to install and use:

npm install zip
/* Only js dependencies, no local building needed */

from test.js

var z = require("zip");
var FS = require("fs");
var data = FS.readFileSync("test.zip")
var reader = z.Reader(data);
console.log(reader.toObject('utf-8'));

Provides also ways to iterate through the zip entries and getting data through Buffer s.

Node为ZLIB库提供支持,允许您使用gzip解压缩zip文件: http//nodejs.org/docs/v0.5.8/api/zlib.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM