On this page

    vm.compileFunction(code, params?, options?): Function
    Attributes
    code:string
    The body of the function to compile.
    params:string[]
    An array of strings containing all parameters for the function.
    options:Object
    filename?:string
    Specifies the filename used in stack traces produced by this script. Default: ''.
    lineOffset?:number
    Specifies the line number offset that is displayed in stack traces produced by this script. Default: 0.
    columnOffset?:number
    Specifies the first-line column number offset that is displayed in stack traces produced by this script. Default: 0.
    cachedData:Buffer | TypedArray | DataView
    Provides an optional Buffer or TypedArray, or DataView with V8's code cache data for the supplied source. This must be produced by a prior call to vm.compileFunction() with the same code and params.
    produceCachedData?:boolean
    Specifies whether to produce new cache data. Default: false.
    parsingContext:Object
    The contextified object in which the said function should be compiled in.
    contextExtensions?:Object[]
    An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling. Default: [].
    Used to specify the how the modules should be loaded during the evaluation of this function 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.
    Returns:Function

    Compiles the given code into the provided context (if no context is supplied, the current context is used), and returns it wrapped inside a function with the given params.