I'm using node-s3-client and want to save all contents of my bucket into an array. The problem is there is more than 1000 files in the bucket and this is the max. I've seen an example here I am just unsure how to use the Marker and isTruncated. I have the following code to get the first 1000 files
var s3 = require('s3');
var client = s3.createClient({
maxAsyncS3: 20,
s3RetryCount: 3,
s3RetryDelay: 1000,
multipartUploadThreshold: 20971520,
multipartUploadSize: 15728640,
s3Options: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY
}
});
var params = {
Bucket: process.env.AWS_XML_BUCKET
}
client.s3.listObjects(params, function(err, data) {
if(err)throw err;
console.log(data.Contents);
});
If anyone knows how I could implement something like the example listed above to list all keys that would be great. As I mentioned when I posted my question I have seen that example and linked it. I am just unsure how to use Marker and get it working.