I'd like to execute an untrusted js code using runInNewContext in node.js but as far as I see there is no way to limit its execution time. Also it is a sync operation. is there a way to set timeout on it or async version of it that will allow me to control its execution from 'outside'?
UPDATE: running in an external process is no good:
- takes too much resources
- more importantly, I need the code to have access to my data/code though sandbox environment