Skip to content

Instantly share code, notes, and snippets.

@jrgm
Created October 16, 2013 05:23
Show Gist options
  • Save jrgm/7002994 to your computer and use it in GitHub Desktop.
Save jrgm/7002994 to your computer and use it in GitHub Desktop.
hook-process-stderr-write.js
process.stderr.write = (function(writer) {
return function(string, encoding, fd) {
writer.call(process.stderr, 'hooked => ');
writer.apply(process.stderr, arguments);
}
})(process.stderr.write);
process.stderr.write('foo\n');
console.error('bar');
console.log('baz');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment