function interceptor(string) {
    // only intercept the string
    var result = callback(string);
    if (typeof result === 'string') {
      string = result.replace(/\n$/, '') + (result && /\n$/.test(string) ? '\n' : '');
    }
    return string;
  }
Intercepts stdout, passes thru callback
also pass console.error thru stdout so it goes to callback too
(stdout.write and stderr.write are both refs to the same stream.write function)
returns an unhook() function, call when done intercepting

@param {Function} callback
@return {Function}