This applies to Node.js versions 4.0.0-7.x
I have some Node.js code, and would like to get it running the browser. In many places in my Node.js code, I have made calls to process.stdout.write and process.stderr.write.
In the browser, we have console.log / console.error
I do not need high-performance here. If I implement these methods in the browser like so:
process.stdout.write = function(v){
return console.log(v);
};
process.stdout.error = function(v){
return console.error(v);
};
that's obviously not going to really get us what we want.
Is there a way to hook into console.log / console.error in the browser to print to stdout/stderr without printing a newline char?
This is sort of about Node.js but more about browser internals, but thought someone might know around here, thanks