I have another question (last question). At the moment i am working on a Node.js project and in this I have many console.log() functions. This has worked ok
const fs = require('fs');
const myConsole = new console.Console(fs.createWriteStream('./output.txt'));
myConsole.log('hello world');
This will create an output file with all the output which can been triggered through console.log('hello world')
inside the console.
This is the easiest way to convert the console.log()
output into a text file.`