Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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输出库
- Host: GitHub
- URL: https://github.com/simon-he95/colorize
- Owner: Simon-He95
- License: mit
- Created: 2022-11-24T08:50:20.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T20:19:52.000Z (11 months ago)
- Last Synced: 2024-09-22T07:18:22.902Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 144 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
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)
![sponsors](https://www.hejian.club/images/sponsors.jpg)