Top-level await


#1

Saw that https://runkit.com/docs/await
shows how to use await inside RunKit directly.

This work currently because nodejs wrap the module in a function call. But it may not work in the future.

Some good read about this topic: https://gist.github.com/Rich-Harris/0b6f317657f5167663b493c722647221


#2

Hi Unional,

With RunKit we actually do our own transforms on user code, so top level awaits will always work in RunKit (unless of course we change it).

Thanks,
-Randy


#3

The examples at https://runkit.com/docs/await do not works anymore, I get Error: Cannot find module 'is-retry-allowed' exception when I try to run await example.


#4

This is fixed now, sorry for the issues!

Thanks,

Francisco