This feature would do something every time text is logged to the node.js console. Here’s a somewhat of example of how I think it should look like:
on('console', msg => {console.log("text was logged! " + msg)})
Regular node.js
Advertisement
Answer
Console methods don’t emit events, but the console object and its methods can be overwritten, so you could redefine it yourself: console.log = (...args) => { process.stdout.write('logged: ' + args.join(' ')) }
, or wrap it in a Proxy.