Hacker News new | ask | show | jobs
by mweberxyz 1862 days ago
Top-level await is very, very new and requires ES modules -- you can only use this feature without warnings recently in Node 15. For the foreseeable future, the final line should be replaced with:

    withAsync()
       .then(() => print("done")
       .catch((err) => console.error(err);
1 comments

You're right, thank you for the explanation. My REPL runs the code in the textarea in an anonymous Async function, which is why top level async works in my examples.