From 98ad11647cd1db0f36466e2a6c43f3ea9c00d51f Mon Sep 17 00:00:00 2001 From: Arunkumar Palaniappan Date: Tue, 20 Jun 2017 09:00:33 +0530 Subject: [PATCH] Fixed DeprecationWarning: Archiver.bulk() deprecated since 0.21.0 --- index.js | 16 +++++++++------- package.json | 3 ++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index 61b8c81..0302f33 100644 --- a/index.js +++ b/index.js @@ -1,19 +1,21 @@ -var fs = require('fs'); -var archiver = require('archiver'); +const fs = require('fs'); +const archiver = require('archiver'); -function zipFolder(srcFolder, zipFilePath, callback) { +const zipFolder = (srcFolder, zipFilePath, callback) => { var output = fs.createWriteStream(zipFilePath); var zipArchive = archiver('zip'); - + output.on('close', function() { callback(); }); zipArchive.pipe(output); - zipArchive.bulk([ - { cwd: srcFolder, src: ['**/*'], expand: true } - ]); + zipArchive.glob('**/*', + { cwd: srcFolder, + src: ['**/*'], + expand: true } + ); zipArchive.finalize(function(err, bytes) { if(err) { diff --git a/package.json b/package.json index 2de8ef7..0535680 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ }, "homepage": "https://github.com/sole/node-zip-folder", "dependencies": { - "archiver": "^0.11.0" + "archiver": "1.3.0", + "fs": "0.0.1-security" }, "devDependencies": { "nodeunit": "^0.9.0",