Last active 1731093970

knox revised this gist 1731093970. Go to revision

1 file changed, 11 insertions

Async-2.js(file created)

@@ -0,0 +1,11 @@
1 + import { mapLimit } from "async-es";
2 +
3 + // ...or ES2017 async functions
4 + mapLimit(urls, 5, async function(url) {
5 + const response = await fetch(url)
6 + return response.body
7 + }, (err, results) => {
8 + if (err) throw err
9 + // results is now an array of the response bodies
10 + console.log(results)
11 + })
Newer Older