Implementing Timeouts in Node.js ‘vm’ Module

Comments

Trusted, but Unknown

When I first started playing with the Node vm module, I was using it to execute trusted, but unknown script. Using the vm module as a sandbox was a great way to get a prototype up and running quickly, but presented a few problems if this type of prototype were to ever run in a production environment. The goal of the prototype was to give other developers the ability to execute script they wrote inside of my app. Everyone makes typos and mistakes, and if a fellow developer asked the sandbox to execute something which entered an endless loop, it would loop the node process and defeat the purpose of a multi-user non-blocking app. Read on →