Skip to content

Instantly share code, notes, and snippets.

@batrudinych
Last active January 9, 2019 09:48
Show Gist options
  • Save batrudinych/36d485cceccf1fdbad56828f2e17d6f6 to your computer and use it in GitHub Desktop.
Save batrudinych/36d485cceccf1fdbad56828f2e17d6f6 to your computer and use it in GitHub Desktop.
[s3-redeploy]-sequential-files-uploading
const fs = require('fs');
const aws = require('aws-sdk');
const s3Client = new aws.S3();
async function uploadFilesToS3(fileNames) {
for (const fileName of fileNames) {
const fileStream = fs.createReadStream(fileName);
await s3Client.upload({
Key: fileName,
Body: fileStream,
}).promise();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment