For making output colorful in node.js I am using chalk. I wonder, if there are any ways to color console.trace() output?
In Node.js, method console.trace compiles the data and then forwards it into console.error.
Below is an example of using module manakin:
require('manakin').global;
console.trace(); // prints the trace using red
Since the library assigns red color by default to method console.error, the trace will also appear red, though you can change it:
var con = require('manakin').global;
con.error.color = 35; // use magenta for errors;
console.trace(); // prints the trace using magenta
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With