@simon_he/colorize
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

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

Buy Me A Coffee

sponsors

Readme

Keywords

none

Package Sidebar

Install

npm i @simon_he/colorize

Weekly Downloads

17

Version

0.0.1

License

MIT

Unpacked Size

8.78 kB

Total Files

6

Last publish

Collaborators

  • simon_he