Can you debug colours with console.log in node.js?
A thought occured to me after I posted about using console.log to debug colours to the browser devtools console: can we use the same technique but in node.js?
Meaning, what happens if I ran this with node.js?
console.log('%cam I red?', 'color: red');
If it worked, I would get something like what I get when running it in the browser console:

Unfortunately it doesn't work... at least in my installation of node.js:

The way that terminal output works is... complicated, so I'm not surprised that this doesn't work outright.
However, if you still wanted to output colours, I'd say the easier way would be to find a library that does the hard work of dealing with the terminal in node.js, so you can focus on the colour side of things!
Something like terminal-kit looks fun and full of features, although I haven't used it myself so can't comment on how well it works. It's not a like-for-like replacement for the way you can format things in the browser, but a couple of functions look close enough. From its docs:
colorRgb(r,g,b): pick the closest match for an RGB value (from a 16 or 256 colors palette or even the exact color if the terminal support 24 bits colors), r,g,b are in the 0..255 rangecolorRgbHex(rgb): pick the closest match for an RGB value (from a 16 or 256 colors palette or even the exact color if the terminal support 24 bits colors), where rgb is in the hex format, e.g. #ef1234