I was reading a blog that have the below sample code,
async function fAsync() {
// actual return value is Promise.resolve(5)
return 5;
}
// can\'t call
A "top level await" is currently at stage 2 (draft) on TC39's ECMAScript standard
https://github.com/tc39/proposal-top-level-await
It has been at stage 2 for 3 years, so, I don't know if it will ever make it to stage 3 (candidate) let alone stage 4 (finished)
Original answer was in November 2018. In June 2019 top level await graduated to stage 3 (candidate). Stage 4 is very likely to follow, but hard to say when.
Side note : If you want to dive deeper, this gist and some of its comments are informative on the subject.