code: function WorkerServer(ts) {
      var worker = new Worker(ts.options.workerScript);
      worker.postMessage({type: "init",
                          defs: ts.options.defs,
                          plugins: ts.options.plugins,
                          scripts: ts.options.workerDeps});
      var msgId = 0, pending = {};
  
      function send(data, c) {
        if (c) {
          data.id = ++msgId;
          pending[msgId] = c;
        }
        worker.postMessage(data);
      }
      worker.onmessage = function(e) {
        var data = e.data;
        if (data.type == "getFile") {
          getFile(ts, data.name, function(err, text) {
            send({type: "getFile", err: String(err), text: text, id: data.id});
          });
        } else if (data.type == "debug") {
          console.log(data.message);
        } else if (data.id && pending[data.id]) {
          pending[data.id](data.err, data.body);
          delete pending[data.id];
        }
      };
      worker.onerror = function(e) {
        for (var id in pending) pending[id](e);
        pending = {};
      };
  
      this.addFile = function(name, text) { send({type: "add", name: name, text: text}); };
      this.delFile = function(name) { send({type: "del", name: name}); };
      this.request = function(body, c) { send({type: "req", body: body}, c); };
    }
docs: Worker wrapper