Confine runtime: Runs javascript in an isolate using isolated-vm.
Install:
npm i jsisolate-confine-runtime
Typically this should be passed into Confine, but here are the constructor options:
const runtime = new JsIsolateConfineRuntime({
source: ArrayBuffer, // script source
path: string, // the path to the script
env: 'vanilla' | 'nodejs',
module: 'cjs' | 'esm',
globals: {
// ... any globals you want to define
},
cjs: {
requires: {
// ... any require overrides you want to define
// a map of 'module-name' -> 'path'
}
},
esm: {
disableImports: boolean // disallow imports?
}
})