UNPKG

micro-ansi

Version:

Easily use 4 bit ANSI colors in your HTML or terminal

36 lines (28 loc) 1.79 kB
# micro-ansi Easily use 4 bit ANSI colors in your HTML or terminal ## Why Well, because I can. And as lovely as Chalk is, it's a bit over-engineered for use with Next.js and gives me more errors than it was worth. <ul> <li>Use with TypeScript or JavaScript.</li> <li>NextJS safe.</li> <li>Super simple. It's literally tiny.</li> </ul> ## Installation ```sh npm import micro-ansi ``` ## Usage ```javascript ansi.color("Text goes here") ``` ## Color Examples | Normal Color | Bright Color | |--------------|--------------| | ![black](https://via.placeholder.com/15/000000/000000?text=+) `black` | ![brightBlack](https://via.placeholder.com/15/808080/000000?text=+) `brightBlack` | | ![red](https://via.placeholder.com/15/FF0000/000000?text=+) `red` | ![brightRed](https://via.placeholder.com/15/F08080/000000?text=+) `brightRed` | | ![green](https://via.placeholder.com/15/00FF00/000000?text=+) `green` | ![brightGreen](https://via.placeholder.com/15/90EE90/000000?text=+) `brightGreen` | | ![yellow](https://via.placeholder.com/15/FFFF00/000000?text=+) `yellow` | ![brightYellow](https://via.placeholder.com/15/FFFFE0/000000?text=+) `brightYellow` | | ![blue](https://via.placeholder.com/15/0000FF/000000?text=+) `blue` | ![brightBlue](https://via.placeholder.com/15/ADD8E6/000000?text=+) `brightBlue` | | ![magenta](https://via.placeholder.com/15/FF00FF/000000?text=+) `magenta` | ![brightMagenta](https://via.placeholder.com/15/EE82EE/000000?text=+) `brightMagenta` | | ![cyan](https://via.placeholder.com/15/00FFFF/000000?text=+) `cyan` | ![brightCyan](https://via.placeholder.com/15/E0FFFF/000000?text=+) `brightCyan` | | ![white](https://via.placeholder.com/15/FFFFFF/000000?text=+) `white` | ![brightWhite](https://via.placeholder.com/15/FFFFFF/000000?text=+) `brightWhite` |