SourceTextModule
This feature is only available with the --experimental-vm-modules command flag enabled.
The vm.SourceTextModule class provides the Source Text Module Record as defined in the ECMAScript specification.
Since
v9.6.0
Properties
The identifier of the current module, as set in the constructor.
The requested import dependencies of this module. The returned array is frozen to disallow any changes to it.
The current status of the module. Will be one of:
Functions
Evaluate the module.
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.
Returns whether the module itself contains any top-level await expressions.
Instantiate the module with the linked requested modules.
Link module dependencies. This method must be called before evaluation, and can only be called once per module.
Link module dependencies. This method must be called before evaluation, and can only be called once per module.