package
Eval a JS string as if it was a file being required
npm install eval-as-moduleGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Eval a JS string as if it was a file being required
npm install eval-as-modulethen in your app:
var run = require('eval-as-module')Runs str as if it were a module at path and returns the module object
run('module.exports = require("eval-as-module")', __filename).exports // => runAnd like eval it also gives you access to the value of the last statement executed in the script.
run('1;2;3').return // => 3