bucket-list

Get a file list from an Amazon S3 bucket.

Bucket List

Get a file list from an Amazon S3 bucket.

Supports streams and callbacks.

npm install bucket-list
 
var BucketList = require('bucket-list');
var bucket = BucketList.connect({
  key: 's3-key',
  secret: 's3-secret'
  bucket: 'name-of-the-s3-bucket'
});
 
 
// Stream bucket files 
 
var bucketStream = bucket('folder_name');
 
bucketStream.on('data', function (fileNameWithPath) {
  console.log(fileNameWithPath);
});
 
 
// Callback style with bucket files 
 
bucket('folder_name', function (errfiles) {
  console.log(files);
});