Skip to content

Instantly share code, notes, and snippets.

@galElmalah
Last active October 23, 2021 14:01
Show Gist options
  • Save galElmalah/aa949b89c01c5dc36ad59ed97230b03c to your computer and use it in GitHub Desktop.
Save galElmalah/aa949b89c01c5dc36ad59ed97230b03c to your computer and use it in GitHub Desktop.
const axios = require('axios')
const fs = require('fs')
const jobs = []
for (let index = 0; index < 40; index++) {
jobs.push('https://static.parastorage.com/services/promote-seo/1.2335.0/business-manager-component.bundle.min.js')
}
console.log('running ',+jobs.length, ' jobs')
console.time('download and write')
Promise.all(jobs.map((url, i) => axios.get(url).then(({data}) => {
return fs.promises.writeFile(__dirname + `/temp/${i}.js`,data)
}))).then(() =>
console.timeEnd('download and write')
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment