zipfolder
v1.0.4
Published
Zip a folder.
Downloads
32
Readme
Zip a folder easily
Usage
zip a folder to current path
var zip = require('zipfolder'); // test-folder/ => test-folder.zip zip.zipFolder({folderPath: 'test-folder'}, function (err, path) { if (err) { console.log(err); } else { console.log(path); } });
zip a folder to other path
// test-folder/ => output-folder/test-folder.zip zip.zipFolder({folderPath: 'test-folder', targetFolderPath: 'output-folder'}, function (err, path) { if (err) { console.log(err); } else { console.log(path); } });
use promise
// use Q promise zip.zipFolder({folderPath: 'test-folder', targetFolderPath: 'output-folder'}) .then(function (path) { console.log(path); }, function (err) { console.log(err); });