I need to download all files and folders from an s3 bucket to a local folder in sam hierarchy.
Suppose my s3 bucket basepath is: myBucket/user1/
in which and user1 may have dynamic values. Every folder for users contains 3 sub folders image, audio, video and files in them.
i just want to download all files in folder user1 to local file system in paths
/assets/s3files/user1/<FILES & FOLDERS HERE>
i have tried: skipper-better-s3, but it reads one the file we have passed.
adapter = require('skipper-better-s3')({
key: 'xxxxxxxxx',
secret: 'yyyyyyyyyyy',
bucket: 'myBucket'
});
adapter.read('/assets/s3files/user1/image/file1.jpg', (err, data) => {
// data is now a Buffer containing the avatar
});