Skip to content

Instantly share code, notes, and snippets.

/*
AWS SDK for Node.js provides the s3.listObjects API which
lists the objects from a bucket. However, if you have a lot
of objects in your bucket then the response of this API is
truncated. So, the entire contents of a bucket cannot be
fetched in a single API call and you need to call the API
multiple times, each time passing a `marker` parameter which
is the `Key` of the last element of the previous response.
This gist is demonstrating the same. This script uses async/await
feature of the Node.js so make sure you have the appropirate