I tried console.log('message') , but it returns the message in black.
console.log('message')
Is there a way to write a message in color in a generator?
You can use the same Chalk color module that the generator system uses to colorize your text.
Install it first: npm install --save chalk
npm install --save chalk
Then:
var chalk = require('chalk'); console.log(chalk.bold.yellow('message'));
For new users viewing this question console.log(); should never be used in Yeoman, according to the documentation . use generator.log(); instead generator.log(); mostly in practice like this.log() .
console.log();
generator.log();
this.log()
Source: https://habr.com/ru/post/1498165/More articles:What is the surrounding class in linguistic agnostic context and in typescript? - classCrypt function does not work when comparing a string with a hash - phpEnable CORS in google app engine blobstore downloader - pythonYouTube Data API v3 for downloading 403 videos is prohibited: YouTubeSignUpRequired - youtube-apiHow to insert youtube api v3 video through a ruby ββservice account - ruby ββ| fooobar.comHow to run PHPUnit tests in a specific order - phpAnsicon crashes my ruby ββWindows 8 - windowsHow to create truly responsive typography in CSS3 regarding screen width - css3how to calculate the number of days between two dates except weekend java - javaWPF DPI creates problems with two borders - dpiAll Articles