I guess this in not chalk fault, but I'm still puzzled.
I would like stderr in red fo a clear differentiation. However :
var chalk = require('chalk');
console.log('msg on stdout'); <-- black
console.error('msg on stderr'); <-- black
console.log(chalk.styles.blue.open); <-- I expect to set stdout to blue (for test)
console.log('msg on stdout'); <-- blue
console.error('msg on stderr'); <-- blue, why ?
console.error(chalk.styles.red.open); <-- I expect to set stderr to red
console.log('msg on stdout'); <-- red, why ?
console.error('msg on stderr'); <-- red
node.js console documentation explicitely states that log goes to stdout and error to stderr. So how comes colors are set for both outputs ?
Use StackOverflow for support questions.
wow.
The reason that colors are set for both outputs is that you are rendering them in the same stream.
If you'd redirect stdout and stderr to different files the coloring of the individual streams would match your expectations.
@jbnicolai thanks. Got it.