cli-color that takes into account process.stdout.isTTY
The cli-color module but TTY aware. It provides a cli-color compatible API that doesn't colorize your strings for non-TTY use.
var clc = true// clc is = require('cli-color')console // -> '\x1b[31mRED\x1b[39m'clc = false// clc is a cli-color compatible API that doesn't colorizeconsole // -> 'RED'
var clc = /* true/false/default: process.stdout.isTTY */
After calling the factory function, use it as per the cli-color docs.
true to the factory function to get back the cli-color module.
false to get back a cli-color compatible object that doesn't colorize your strings.