3 ms·Having to use an async immediately invoked function expression in Node scripts is kind of a pain, but I agree.by 1f60c 6y agoHaving to use an async immediately invoked function expression in Node scripts is kind of a pain, but I agree.cpfohl 6y agoI haven't found it painful, but i avoid iife in favor of a named function I call... ``` async function main() { await stuff(); } if (module === require.main) main(); ```infensus 6y agoTop-level await is available in ES modules in Node without any flags since 14.8.0