Skip to content
Patrik Simek edited this page Jun 16, 2016 · 12 revisions
  • v3 requires Node.js version 6 or newer.
  • To contextify objects between sandboxes v3 uses Proxies rather than deep clone.
  • Native modules are no longer recompiled in sandbox, they're now Proxied.
  • There is no need to call functions inside sandbox with vm.call method.
  • Issue with Buffer not being instance of Buffer is now fixed (#22).

VM options

let options = {
    console: 'inherit',
    sandbox: {},
    require: true,
    requireExternal: true,
    requireNative: ['fs', 'path'],
    requireRoot: "./",
    language: 'javascript',
    useStrict: true
};

changed to:

let options = {
    console: 'inherit',
    sandbox: {},
    require: {
        external: true,
        native: ['fs', 'path'],
        root: "./"
    },
    compiler: 'javascript'
};

NOTE: useStrict option was removed.

Clone this wiki locally