使用chalk定义输出样式:Chalk comes with an easy to use composable API where you just chain and nest the styles you want.

npm的chalk包的使用

 

const chalk = require('chalk')

console.log(chalk.blue('Hello world!'))


console.log(chalk.hex('#DEADED').underline('Hello, world!'))
console.log(chalk.keyword('orange')('Some orange text'))
console.log(chalk.rgb(15, 100, 204).inverse('Hello!'))

console.log(`==========================`)
const error = chalk.bold.red;
const warning = chalk.keyword('orange');

console.log(error('Error!'));
console.log(warning('Warning!'));

---

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2021-07-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
相关资源
相似解决方案