The top-level await doesn’t need an explicit async function wrapper. This only works when call is made at the top level of modules. There are ways to mix things up without adding to the file.
Table of contents
Top level await() without async()⇒{…} in NodeJsLet’s now talk about a different scenario:Behind the scenes:Here are some points straight from the official NodeJs documentation :But before you get overly optimistic…Sort: