Download selected files from an Amazon S3 bucket as a zip file.
npm install s3-zip
Refer to the AWS SDK for authenticating to AWS prior to using this plugin.
var s3Zip = require('s3-zip');
var fs = require('fs');
var region = 'bucket-region';
var bucket = 'name-of-s3-bucket';
var folder = 'name-of-bucket-folder/';
var file1 = 'Image A.png';
var file2 = 'Image B.png';
var file3 = 'Image C.png';
var file4 = 'Image D.png';
var output = fs.createWriteStream(__dirname + '/use-s3-zip.zip');
s3Zip
.archive({ region: region, bucket: bucket}, folder, [file1, file2, file3, file4])
.pipe(output);
Example of s3-zip in combination with AWS Lambda.
Tests are written in Node Tap, run them like this:
npm t
If you would like a more fancy report:
npm test -- --cov --coverage-report=lcov