Reputation: 2297
Is there any easy lib that can zip an entire folder's contents in a simple line, without having to recurse through the folder structure yourself, along the lines of:
zip('./folder/').output('zipped.js')
Upvotes: 2
Views: 4129
Reputation: 2297
You can use zip-folder like this:
Installation:
npm i zip-folder
Usage:
var zipFolder = require('zip-folder');
zipFolder('/path/to/the/folder', '/path/to/archive.zip', function(err) {
if(err) {
console.log('oh no!', err);
} else {
console.log('EXCELLENT');
}
});
Upvotes: 3