Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/simon-he95/colorize

一个基于picocolors封装的colorful terminal输出库
https://github.com/simon-he95/colorize

Last synced: 10 days ago
JSON representation

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

Awesome Lists containing this project

README

        

![kv](/assets/kv.png)

一个基于[picocolors](https://github.com/SimonHe1995/picocolors)封装的colorful terminal输出库

![screenshot](/assets/screenshot.png)

## Install
```
npm i @simon_he/colorize
```

## Usage
```js
import colorize from '@simon_he/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](./LICENSE) License © 2022 [Simon He](https://github.com/Simon-He95)

Buy Me A Coffee

![sponsors](https://www.hejian.club/images/sponsors.jpg)