npm的chalk包的使用


  使用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!'));

---


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM