https://github.com/metaory/mini-ansi
🎨 Tiny ANSI color escape utility in under 10 line!
https://github.com/metaory/mini-ansi
ansi color javascript js npm npm-package
Last synced: 4 months ago
JSON representation
🎨 Tiny ANSI color escape utility in under 10 line!
- Host: GitHub
- URL: https://github.com/metaory/mini-ansi
- Owner: metaory
- License: mit
- Created: 2024-06-18T07:15:29.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T07:55:35.000Z (almost 2 years ago)
- Last Synced: 2025-10-06T08:56:10.919Z (8 months ago)
- Topics: ansi, color, javascript, js, npm, npm-package
- Language: JavaScript
- Homepage: https://npmjs.com/package/mini-ansi
- Size: 256 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
mın̶ı AN̶S̶I
minimal ansi escape colors
zero dependencies
---
## DESCRIPTION
Minimal ANSI color escape utility in [under 10 lines](src/index.js)!
---
Usage
-----
```sh
# install
npm install mini-ansi
```
```js
// const ansi = require('mini-ansi') // CJS
import C from 'mini-ansi' // ESM
const { log } = console
log(C.f2('green fg'), 'normal text', C.b4(' red bg '))
log('norm', C.f1b3('red fg and yellow bg'), 'orrr', C.b2f6('cyan fg ongreen bg'))
```
> [!Caution]
> ONLY SUPPORT base16
>
> - `f` or `b` can come in any order
> [!Important]
> NOT_IMPLEMENTED
>
> - color names
> - modifiers
> - background color
> - tag function for template literals
> - chained calls
## Why not ...
- [ ] TODO: WRITE REASONS!
---
## License
[MIT](LICENSE)