niceuho
auto format console output with chalk for node
console.log, .info, .warn, .error doesn't have a specific color scheme in a terminal with node. (it exists mostly to miror console api for browser)
So i created a simple package that use chalk
to add some colors and style to console's api for node.
Install
$ npm install niceuho
// or
$ yarn add niceuho
Usage
Default config
console // output white Hello by defaultconsole // output yellow Warning ! by default
Custom config
log : 'blue' error : 'bold' 'underline' 'red' console // output blue Helloconsole // output "Error !" in bold red and underlined
You can use all the modifiers from chalk in the custom (accept a string or an array of string) In the config you can customize log, info, warn and error.
Warning
In order to get a proper formatting you have some constraints. If you want to show an object for example you'll have to use the node's util format syntax.
console.log("object : %o", myobj)
You can find ore information here : util