Last active
April 9, 2018 00:08
-
-
Save ragingwind/3609aea34312e307a3efdc8d29ba2a3b to your computer and use it in GitHub Desktop.
running code block by wrapping module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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