cross-zip

Cross-platform .zip file creation

MIT 14 个版本
安装
npm install cross-zip
yarn add cross-zip
pnpm add cross-zip
bun add cross-zip
README

cross-zip ci npm downloads javascript style guide

Cross-platform .zip file creation

install

npm install cross-zip

usage

var zip = require('cross-zip')

var inPath = path.join(__dirname, 'myFolder') // folder to zip
var outPath = path.join(__dirname, 'myFile.zip') // name of output zip file

zip.zipSync(inPath, outPath)

api

zip.zip(inPath, outPath, [callback])

Zip the folder at inPath and save it to a .zip file at outPath. If a callback is passed, then it is called with an Error or null.

zip.zipSync(inPath, outPath)

Sync version of zip.zip.

zip.unzip(inPath, outPath, [callback])

Unzip the .zip file at inPath into the folder at outPath. If a callback is passed, then it is called with an Error or null.

zip.unzipSync(inPath, outPath)

Sync version of zip.unzip.

Windows users

This package requires .NET Framework 4.5 or later and Powershell 3. These come pre-installed on Windows 8 or later.

On Windows 7 or earlier, you will need to install these manually in order for cross-zip to function correctly.

reference

license

MIT. Copyright (c) Feross Aboukhadijeh.

版本列表
4.0.1 2024-02-12
4.0.0 2020-11-03
3.1.0 2020-05-10
3.0.0 2020-01-14
2.1.6 2019-08-14
2.1.5 2016-08-13
2.1.4 2016-06-22
2.1.3 2016-05-29
2.1.2 2016-05-15
2.1.1 2016-05-15
2.1.0 2016-05-02
2.0.1 2016-04-27
2.0.0 2016-04-27
1.0.0 2016-04-16