I'm am capturing console.log
data and saving it to a log file but I also want to show the data in the console. How can I do this? I'd rather not install a package just do this.
This is what I am using to capture the console.log
data:
var stdo = fs.createWriteStream('log.txt', {'flags': 'a'});
var write = function(write) {
return function(string, encoding, fd) {
stdo.write(string);
};
};
process.stdout.write = write(process.stdout.write);