Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/metaory/mini-ansi

🎨 Minimal ANSI color escape utility in under 10 line!
https://github.com/metaory/mini-ansi

ansi color javascript js npm npm-package

Last synced: about 2 months ago
JSON representation

🎨 Minimal ANSI color escape utility in under 10 line!

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)!


pcall_usage

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)