code: async function bucketExists(cli, bucket) {
    try {
      await cli.headBucket({
        Bucket: bucket
      }).promise();
      return true;
    } catch (e) {
      switch (e.statusCode) {
        case 403:
          throw new Error(
            '403: You don\'t have permissions to access this bucket');
        case 404:
          return false;
        default:
          throw e;
      }
    }
  }
docs: return promise that resolves to true/false or rejects with error