orangewise/s3-zip

Examples in README.md use XmlStream unnecessarily

Closed this issue · 1 comments

The docs show XmlStream being used to build a filesArray:

s3-zip/README.md

Lines 92 to 101 in 1c21f82

const xml = new XmlStream(files)
xml.collect('Key')
xml.on('endElement: Key', function(item) {
filesArray.push(item['$text'].substr(folder.length))
})
xml
.on('end', function () {
zip(filesArray)
})


But aws-sdk returns JS objects automatically, e.g:

  const {Contents} = await s3.listObjects(params).promise()
  const keys = Contents.map(({Key}) => Key

So why do we need XmlStream?

I’ve not tested this part myself. Maybe you can add a test and update the readme? I’m happy to merge a PR.