lib/utils/compression.js
function(sourceDir, destFile, opts) {
        opts = opts || { archive_path: '/' };
        return new Promise(function (resolve, reject) {
            try {
                var archive = archiver.create('zip', {
                    zlib: {
                        level: 9
                    }
                });
                var output = fs.createWriteStream(destFile);
                output.on('finish', function () {
                    resolve(destFile);
                });
                archive.pipe(output);
                archive.directory(sourceDir, opts.archive_path);
                archive.finalize();
            } catch(err) {
                reject(err);
            }
        });
    }
function(sourceDir, destFile, opts) {
        opts = opts || { archive_path: '/' };
        return new Promise(function (resolve, reject) {
            try {
                var archive = archiver.create('zip', {
                    zlib: {
                        level: 9
                    }
                });
                var output = fs.createWriteStream(destFile);
                output.on('finish', function () {
                    resolve(destFile);
                });
                archive.pipe(output);
                archive.directory(sourceDir, opts.archive_path);
                archive.finalize();
            } catch(err) {
                reject(err);
            }
        });
    }
Zips up a directory.

@param sourceDir {string} the directory to be zipped
@param destFile {string} the output file
@param opts {{}}
@returns {Promise.<string>} path to the archive