Created
October 16, 2013 05:23
-
-
Save jrgm/7002994 to your computer and use it in GitHub Desktop.
hook-process-stderr-write.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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