Skip to content

Instantly share code, notes, and snippets.

@theburningmonk
Created February 1, 2020 23:20
Show Gist options
  • Save theburningmonk/6b49d6036f382f56eedb2250b5d66825 to your computer and use it in GitHub Desktop.
Save theburningmonk/6b49d6036f382f56eedb2250b5d66825 to your computer and use it in GitHub Desktop.
const http = require('axios')
module.exports.handler = async (urls) => {
const promises = urls.map(async url => {
return (await http.get(url)).data.length
})
const counts = await Promise.all(promises)
return counts.reduce((x, acc) => x + acc, 0)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment