Fork me on GitHub

NPM之chalk

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

posted @ 2023-03-29 21:59  秋夜雨巷  阅读(132)  评论(0编辑  收藏  举报