MCPcopy Create free account
hub / github.com/antvis/AVA / executeInNode

Function executeInNode

src/interpreter/javascript/sandbox.ts:69–73  ·  view source on GitHub ↗
(data: any[], code: string)

Source from the content-addressed store, hash-verified

67}
68
69async function executeInNode(data: any[], code: string): Promise<any> {
70 const vm = await import('node:vm');
71 const context = vm.createContext({ data, stat });
72 return vm.runInContext(`${code}\nresult;`, context, { timeout: EXECUTION_TIMEOUT });
73}
74
75/**
76 * Execute analysis code with data and stat helpers.

Callers 1

executeCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected