The following code is part of the Node-Red core node libraries, as you can see it executes scripts in a virtual machine "vm" Node Js module.
script on githu