Skip to content

Instantly share code, notes, and snippets.

@ragingwind
Last active April 9, 2018 00:08
Show Gist options
  • Save ragingwind/3609aea34312e307a3efdc8d29ba2a3b to your computer and use it in GitHub Desktop.
Save ragingwind/3609aea34312e307a3efdc8d29ba2a3b to your computer and use it in GitHub Desktop.
running code block by wrapping module
const m = require('module')
const res = vm.runInThisContext(m.wrap(code))(
exports,
require,
module,
__filename,
__dirname
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment