Async snippets & functions
(, en)
Top level async function
(async () => {
var text = await main();
console.log(text);
})().catch((e) => {
// Deal with the fact the chain failed
});
Delay execution
const delay = (ms) => new Promise((res) => setTimeout(res, ms));
await delay(5000);