I'm trying to execute a Function object which is essentially the same as the following pseudo-code:
var testF = new Function("x","y", "var http = require('http');");
testF('foo','bar');
And get:
ReferenceError: require is not defined
Do I need to somehow add something that reloads the require module as it's not a global module in Node? If so, google has not been my friend so any pointers on how to do so would be fantastic.
Thanks for your ideas.