Node.js Intercept write streams
tapit captures or modifies a node js write stream.
intercept-stdout by Steve Farthing
Based onCapture
var intercept = captured_text = "" _stream = fs; var unhook_intercept = ; _stream; // Let's stop capturing stdout.; _stream;
Modify
var intercept = ; var unhook_intercept = ; _stream;// -> that text is being modified
Test
npm install
npm test
About Colorization
Popular modules such as mocha
and winston
may colorize output by inserting ANSI escape codes into the output stream. Both mocha
and winston
make multiple calls to the output streams while colorizing a line -- in order to be robust, your code should anticipate and deal with this.