Skip to content
Patrik Simek edited this page Jun 16, 2016 · 12 revisions
  • 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: "./",
    useStrict: true
};

changed to:

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

NOTE: useStrict option was removed.

Clone this wiki locally