npm install cross-zip
varzip=require('cross-zip')varinPath=path.join(__dirname,'myFolder')// folder to zipvaroutPath=path.join(__dirname,'myFile.zip')// name of output zip filezip.zipSync(inPath,outPath)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.
Sync version of zip.zip.
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.
Sync version of zip.unzip.
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.
- cross-zip-cli: CLI version of cross-zip.
MIT. Copyright (c) Feross Aboukhadijeh.