I want to implement pagination using aws s3. There are 500 files in object ms.files but i want to retrieve only 20 files at a time and next 20 next time and so on.
var params = {
Bucket: 'mystore.in',
Delimiter: '/',
Prefix: '/s/ms.files/',
Marker:'images',
};
s3.listObjects(params, function(err, data) {
if (err) console.log(err, err.stack);
else console.log(data);
});
Solution as shared by Mr Jarmod :