| 133 | * Options for creating a VM |
| 134 | */ |
| 135 | export interface VMOptions { |
| 136 | /** |
| 137 | * `javascript` (default), `typescript`, `coffeescript` or custom compiler function (which receives the code, and it's file path). |
| 138 | * The library expects you to have compiler pre-installed if the value is set to `typescript` or `coffeescript`. |
| 139 | */ |
| 140 | compiler?: "javascript" | "typescript" | "coffeescript" | CompilerFunction; |
| 141 | /** |
| 142 | * Compiler options. |
| 143 | */ |
| 144 | compilerOptions?: Record<string, any>; |
| 145 | /** VM's global object. */ |
| 146 | sandbox?: any; |
| 147 | /** |
| 148 | * Script timeout in milliseconds. Timeout is only effective on code you run through `run`. |
| 149 | * Timeout is NOT effective on any method returned by VM. |
| 150 | */ |
| 151 | timeout?: number; |
| 152 | /** |
| 153 | * If set to `false` any calls to eval or function constructors (`Function`, `GeneratorFunction`, etc.) will throw an |
| 154 | * `EvalError` (default: `true`). |
| 155 | */ |
| 156 | eval?: boolean; |
| 157 | /** |
| 158 | * If set to `false` any attempt to compile a WebAssembly module will throw a `WebAssembly.CompileError` (default: `true`). |
| 159 | */ |
| 160 | wasm?: boolean; |
| 161 | /** |
| 162 | * If set to `true` any attempt to run code using async will throw a `VMError` (default: `false`). |
| 163 | * @deprecated Use `allowAsync` instead. |
| 164 | */ |
| 165 | fixAsync?: boolean; |
| 166 | |
| 167 | /** |
| 168 | * If set to `false` any attempt to run code using async will throw a `VMError` (default: `true`). |
| 169 | */ |
| 170 | allowAsync?: boolean; |
| 171 | } |
| 172 | |
| 173 | /** |
| 174 | * Options for creating a NodeVM |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…