I have following code with async function download_file(), its working correctly only where runs as single, but in loop, it's not waiting end of iteration. https://pastebin.com/PRgJRn9i
(async () => {
for (let year of years) {
for (let month of months) {
for (let r of day_rng) {
await download_file(year, month, r);
}
}
}
})();
awaitkeyword.await (async () => {. Not all versions of node supportawaitat the top level, so you may have to refactor a bit.