Skip to main content

namespace constants

Returns an object containing commonly used constants for VM operations.

Variables #

v
constants.DONT_CONTEXTIFY

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.

    v
    constants.USE_MAIN_CONTEXT_DEFAULT_LOADER

    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.

      Did you find what you needed?

      Privacy policy