(async () => {
let reqs = [];
async function doTasks() {
return Promise.all( reqs.map((req) => doReq(req)) )
.then((tasks) => Promise.all( tasks.map((task) => checkStatus(task)) ))
.catch(console.error);
};
await doTasks();
// do some sync code
})();