NPM之chalk

阅读 59

2023-04-01

chalk

终端打印信息彩色字体,提高辨识度

安装

npm install chalk -S

使用

const chalk = require('chalk')
console.log(chalk.blue('Hello world!'))

定义自己的主题

const chalk = require('chalk')
let log = {
  error(str) {
    chalk.bold.red(str)
  }
  // your own themes
 }

参考: https://zhuanlan.zhihu.com/p/150650900

NPM之chalk_微信公众号




精彩评论(0)

0 0 举报