k6
k6 copied to clipboard
Support top-level-await
Feature Description
Support top-level-await
This lets await being called in the top scope of a module (not a commonjs script).
Allowing users to use k6/experimental/fs.open and others in the init context more ergonomically
Suggested Solution (optional)
This was skipped in #3456 as it required even more changes to the initial loading as it now needs to be 100% asynchronous.
Sobek already supports this, so this will likely mostly be changing signatures inside k6 in js and js/modules
Already existing or connected issues / PRs (optional)
No response
Mentioning it for context: https://github.com/grafana/k6/pull/3743#discussion_r1611326469