eval-as-module
Eval a JS string as if it was a file being required
Installation
npm install eval-as-module
then in your app:
var run =
API
run(str, path)
Runs str
as if it were a module at path
and returns the module object
exports // => run
And like eval
it also gives you access to the value of the last statement executed in the script.
return // => 3