开发者

Intercepting process.stdout.write calls

Hey, seems like this should be simple enough, but I must be missing something. I tried using pipe and on('data') but neither seem to pass me data. The reason I want to do this is I want to be able to have a "dev" section and have the output be streamed to that, but I'd rather not have to write to a file then read from a file then stream that if I can just intercept the data on 开发者_StackOverflow中文版the write call.


A simple way to do this would just be to just replace process.stdout.write with your function. Something like:

process.stdout.write = function() { /* Do your stuff*/ }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜