Bun

interface

vm.CompileFunctionOptions

interface CompileFunctionOptions

  • cachedData?: Buffer<ArrayBufferLike> | ArrayBufferView<ArrayBufferLike>

    Provides an optional data with V8's code cache data for the supplied source.

  • columnOffset?: number

    Specifies the column number offset that is displayed in stack traces produced by this script.

  • contextExtensions?: Object[]

    An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling

  • filename?: string

    Specifies the filename used in stack traces produced by this script.

  • importModuleDynamically?: number | DynamicModuleLoader<Function & { cachedData: Buffer<ArrayBufferLike>; cachedDataProduced: boolean; cachedDataRejected: boolean }>

    Used to specify how the modules should be loaded during the evaluation of this script when import() is called. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see Support of dynamic import() in compilation APIs.

  • lineOffset?: number

    Specifies the line number offset that is displayed in stack traces produced by this script.

  • parsingContext?: Context

    The sandbox/context in which the said function should be compiled in.

  • produceCachedData?: boolean

    Specifies whether to produce new cache data.