Skip to content

Constants7

[<Interface>]
type Constants7 =
    abstract member DONT_CONTEXTIFY: float
    abstract member USE_MAIN_CONTEXT_DEFAULT_LOADER: float
    static member Create (USE_MAIN_CONTEXT_DEFAULT_LOADER: float, DONT_CONTEXTIFY: float) : Constants7
AssemblyXantham.Fable.Node
Attributes[<Interface>]

Properties

abstract member DONT_CONTEXTIFY: float

This constant, when used as the contextObject argument in vm APIs, instructs Node.js to create a context without wrapping its global object with another object in a Node.js-specific manner. As a result, the globalThis value inside the new context would behave more closely to an ordinary one.

When vm.constants.DONT_CONTEXTIFY is used as the contextObject argument to createContext, the returned object is a proxy-like object to the global object in the newly created context with fewer Node.js-specific quirks. It is reference equal to the globalThis value in the new context, can be modified from outside the context, and can be used to access built-ins in the new context directly.

@since v22.8.0

abstract member USE_MAIN_CONTEXT_DEFAULT_LOADER: float

A constant that can be used as the importModuleDynamically option to vm.Script and vm.compileFunction() so that Node.js uses the default ESM loader from the main context to load the requested module.

For detailed information, see Support of dynamic import() in compilation APIs.

@since v21.7.0, v20.12.0

Methods

static member Create (USE_MAIN_CONTEXT_DEFAULT_LOADER: float, DONT_CONTEXTIFY: float) : Constants7