How to apply CSS to console.log coloring automatically
This question already has an answer here:
Have a look at color.js. It provides functions to stylize the console output. Usage is as simple as:
console.log("Yellow text".yellow);
您可以使用图书馆,如粉笔。
const chalk = require('chalk');
// combine styled and normal strings
console.log(chalk.blue('Hello') + 'World' + chalk.red('!'));
链接地址: http://www.djcxy.com/p/87372.html