console-with-style
%c
(CSS styling) support for Node's console.log
Why?
Firefox, Chrome's and Safari's console support styling console.log
output with CSS declarations. Node should to!
How?
It translates CSS styles to ansi escape sequences for the terminal!
Example
const supportsColor =const level = supportsColorstdout && supportsColorstdoutlevel || 0const format = levelconsole
So far, only colors are supported.
Ok ... why again?
If you forward the output of a browser's console to a process in the terminal, it's nice to see the same colors, for example when using debug.
License
MIT