Created
February 27, 2018 13:18
-
-
Save muthuspark/f43b08251cd0ec813dfd75823a644fff to your computer and use it in GitHub Desktop.
Revisions
-
muthuspark created this gist
Feb 27, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ var AWS = require('aws-sdk'); AWS.config.update({ accessKeyId: "ACCESS_KEY", secretAccessKey: "SECRET_ACCESS_KEY" }); // Create an S3 client var s3 = new AWS.S3(); // Create a bucket and upload something into it var bucketName = 'BUCKET_NAME'; var S3Url = "https://s3-us-west-2.amazonaws.com/BUCKET_NAME/"; var params = { Bucket: bucketName, Delimiter: '/' } s3.listObjects(params, function (err, data) { if(err)throw err; data.Contents.forEach(function(k){ console.log(k.Key); });