0.3.1 • Published 2 years ago

jsisolate-confine-runtime v0.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

JS Isolate Confine Runtime

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?
  }
})