code: function run() {
    result = (function() {
      try {
        return Script.runInNewContext('with(this){' + this.toString() + '}', sandbox)
      }
      catch (e) {
        return e.name + ': ' + e.message
      }
    }).call(code)
    
    process.stdout.on('drain', function() {
      process.exit(0)
    })
  
    var msg = util.inspect(result)
    if (msg && msg.length > 2 && msg[0] === "'" && msg[msg.length - 1] === "'") {
      msg = msg.substr(1, msg.length - 2)
    }
    process.stdout.write(JSON.stringify({ result: msg, console: console }))
  }
docs: Run code