DEV Community

Discussion on: Converting to Asynchronous Code Using IIFEs

Collapse
 
pierreneter profile image
Pierre Neter

You can use Top-level await, it has been supported by nodejs 14.3.0 with --experimental-top-level-await flag, to avoid use IIAFEs.
Read more about that: github.com/tc39/proposal-top-level... the limitations on IIAFEs section.

More:
v8.dev/features/top-level-await
bugs.chromium.org/p/v8/issues/deta...