From 7c202e5fafe0fbee93e69452874292898f32e839 Mon Sep 17 00:00:00 2001 From: Nitin bisht Date: Tue, 11 Dec 2018 23:06:37 +0530 Subject: [PATCH 1/2] correct `recursive` key value (#29) key under streamZipDataTo arguments should be true and separated by `:` not `,` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 206c9f3..26b1028 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ app.all('/', function (request, response) { pipe: response , folderName: 'myBucketFolderName' , startKey: 'keyOfLastFileIZipped' // could keep null - , recursive, true + , recursive: true } ,function (err, result) { if(err) From b5035d6337af07a0a01299069b7523f1b73ad209 Mon Sep 17 00:00:00 2001 From: "T. Mjoen" Date: Mon, 5 Aug 2019 21:46:55 +0200 Subject: [PATCH 2/2] Switch from to fs.unlinkSync to fix node 10 err (#27) fs.unlink fails without the `callback` param in node 10 it seems. Switching to fs.unlinkSync fixes the problem for me. ``` TypeError [ERR_INVALID_CALLBACK]: Callback must be a function at makeCallback (fs.js:135:11) at Object.unlink (fs.js:903:14) ``` --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 5cf156e..4c1d81f 100644 --- a/index.js +++ b/index.js @@ -306,12 +306,12 @@ S3Zipper.prototype = { zipFileLocation: result.Location, zippedFiles: r.zippedFiles }); - fs.unlink(params.zipFileName); + fs.unlinkSync(params.zipFileName); }); } else { console.log('no files zipped. nothing to upload'); - fs.unlink(params.zipFileName); + fs.unlinkSync(params.zipFileName); callback(null, { zipFileETag: null, zipFileLocation: null, @@ -382,7 +382,7 @@ S3Zipper.prototype = { if (uploadResult) { result.uploadedFile = uploadResult; console.log('remove temp file ', localFragName); - fs.unlink(localFragName); + fs.unlinkSync(localFragName); } pendingUploads--; if (pendingUploads == 0 && finalResult) { @@ -483,7 +483,7 @@ S3Zipper.prototype = { fileStream.close(); if (result.zippedFiles.length == 0) /// its an empty zip file get rid of it - fs.unlink(fragFileName); + fs.unlinkSync(fragFileName); else events.onFileZipped(fragFileName, result);