examples/s3-backup-stream.js
function bucketAccessible(s3, bucketName) {
  return new Promise(function(resolve, reject) {
    var params = {
      Bucket: bucketName
    };
    s3.headBucket(params, function(err, data) {
      if (err) {
        reject(new VError(err, 'S3 bucket not accessible'));
      } else {
        resolve();
      }
    });
  });
}
function bucketAccessible(s3, bucketName) {
  return new Promise(function(resolve, reject) {
    var params = {
      Bucket: bucketName
    };
    s3.headBucket(params, function(err, data) {
      if (err) {
        reject(new VError(err, 'S3 bucket not accessible'));
      } else {
        resolve();
      }
    });
  });
}
function bucketAccessible ( s3 , bucketName ) { return new Promise ( function ( resolve , reject ) { var params = { Bucket : bucketName } ; s3 . headBucket ( params , function ( err , data ) { if ( err ) { reject ( new VError ( err , 'S3 bucket not accessible' ) ) ; } else { resolve ( ) ; } } ) ; } ) ; }
Return a promise that resolves if the bucket is available and
rejects if not.

@param {any} s3 S3 client object
@param {any} bucketName Bucket name
@returns Promise
Return a promise that resolves if the bucket is available and rejects if not .