MhasAsyncGraph
Bun

method

vm.SourceTextModule.hasAsyncGraph

hasAsyncGraph(): boolean;

Iterates over the dependency graph and returns true if any module in its dependencies or this module itself contains top-level await expressions, otherwise returns false.

The search may be slow if the graph is big enough.

This requires the module to be instantiated first. If the module is not instantiated yet, an error will be thrown.