paulodiovani paulodiovani - 29 days ago 5x
Node.js Question

How to log colored messages with grunt.log

I want to log a warning, yellow message, with Grunt, when running a specific task.

Currently I use

to output bold font, but it does no take to much attention.

grunt.log.subhead 'You may want to use --sourceMaps option'


You can try this:

grunt.log.writeln('You may want to use --sourceMaps option'['yellow'].bold);

The grunt API documentation for log does not mention how to do this. I found it in a set of slides here: