I'd like to be able to safely execute third party javascript inside a Node app. The code they would provide must be entirely pure, which means I can happily isolate them from anything globally available.
They will need to call certain libraries but I can provide a form of the require function which is limited to providing only other pure functions. They won't need anything other than what I give them. They should be unable to use any tricks to access anything outside of the closure I wrap their function in.
Does anyone know if this is possible?