paulodiovani paulodiovani - 10 months ago 100
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'

Answer Source

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: