cross-zip-opts
v4.0.2
Published
Cross-platform .zip file creation // Fork of @feross with support for opts
Downloads
52
Maintainers
Readme
cross-zip-opts
Cross-platform .zip file creation
install
npm install cross-zip-opts
usage
var zip = require('cross-zip-opts')
var inPath = path.join(__dirname, 'myFolder') // folder to zip
var outPath = path.join(__dirname, 'myFile.zip') // name of output zip file
let opts {
cwd:path.join(__dirname)
}
zip.zipSync(inPath, outPath,opts,function(err){
[...]
})
api
zip.zip(inPath, outPath, opts, [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-opts
to function correctly.
reference
related
- cross-zip-opts-cli: CLI version of cross-zip-opts.
license
MIT. Copyright (c) Feross Aboukhadijeh.