I'm using chalk to colour the output from from my command-line node application. Normally like this:
console.log(chalk.red(error));
However, I need to pipe stdout from a child process, and colour this output too:
var child = childProcess.spawn('foo', args);
child.stdout.pipe(process.stdout); //how to use chalk to colour this?
How do I use chalk to apply a colour when piping stdout in from a child process?