首页 > 其他 > 详细

npm的chalk包的使用

时间:2020-01-19 00:13:39      阅读:130      评论:0      收藏:0      [点我收藏+]

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

技术分享图片

 

 

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!‘));

---

技术分享图片

npm的chalk包的使用

原文:https://www.cnblogs.com/xy-ouyang/p/12210608.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!