0.0.1 • Published 3 years ago

@simon_he/colorize v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

colorize

一个基于picocolors封装的colorful terminal输出库

Install

  npm i @simonhe/colorize

Usage

  import colorize from '@simonhe/colorize'

  colorize({
    text:'hi',
    color:'red',
  })
  colorize({
    text:'hi',
    bgColor:'red',
  })
  colorize({
    text:'hi',
    bgColor:'red',
    dimmed:true
  })
  /*
  color?: IColors
  bgColor?: IColors
  dimmed?: boolean
  bold?: boolean
  italic?: boolean
  underline?: boolean
  strikethrough?: boolean
  inverse?: boolean
  text: string
  */

Why use picocolors

  • No dependencies.
  • 14 times smaller and 2 times faster than chalk.
  • Used by popular tools like PostCSS, SVGO, Stylelint, and Browserslist.
  • Node.js v6+ & browsers support. Support for both CJS and ESM projects.
  • TypeScript type declarations included.
  • NO_COLOR friendly.

License

MIT

sponsors