Skip to content

Instantly share code, notes, and snippets.

@denysdovhan
Last active March 26, 2016 15:08
Show Gist options
  • Save denysdovhan/26e28df661bcd4a1c669 to your computer and use it in GitHub Desktop.
Save denysdovhan/26e28df661bcd4a1c669 to your computer and use it in GitHub Desktop.
JS Functions Container
console.log('This is test.js');
console.log(scope.passed);
const fs = require('fs');
const scope = {
"passed": 'This is passed value'
};
fs.readFile('./file.js', 'utf-8', (err, program) => {
if (err) throw err;
(new Function("scope", program))(scope);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment