Using await at the top level in ES modules
Writing asynchronous code in JavaScript used to come with a limitation: the await keyword could only be used inside an async function. That changed when ES2022 introduced top-level await, which lets you use await at the top of an ES module. What’s top-level await? Traditionally await was only valid inside...