code: function wrapWrite(std, print) {
    process[std].write = function (data) {
      cachedData[std].push(data);
  
      if (print)
        originalWrites[std].apply(process[std], arguments);
    };
  }
docs: Wrap write method.
  
  @param {string} std Std
  @param {boolean} print Also print to std