FcompileFunction
Bun

function

vm.compileFunction

function compileFunction(
code: string,
params?: readonly string[],
): Function & { cachedData: Buffer<ArrayBufferLike>; cachedDataProduced: boolean; cachedDataRejected: boolean };

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.

@param code

The body of the function to compile.

@param params

An array of strings containing all parameters for the function.