https://github.com/nehu3n/litecolor
🎨 An ultra-tiny and elegant console style library compatible with any environment.
https://github.com/nehu3n/litecolor
agnostic chalk colors console elegant styles tiny
Last synced: about 1 month ago
JSON representation
🎨 An ultra-tiny and elegant console style library compatible with any environment.
- Host: GitHub
- URL: https://github.com/nehu3n/litecolor
- Owner: nehu3n
- License: mit
- Created: 2025-02-03T00:19:50.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-02-04T00:02:22.000Z (8 months ago)
- Last Synced: 2025-08-09T10:04:20.774Z (about 2 months ago)
- Topics: agnostic, chalk, colors, console, elegant, styles, tiny
- Language: TypeScript
- Homepage: https://npmjs.com/litecolor
- Size: 46.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LiteColor
An ultra-tiny, elegant, and agnostic library for console styling, written in TypeScript.
```ts
import { style } from "litecolor";const text = style("Hello world!")
.color("green")
.bold()
.toString();console.log(text);
```##### See more examples in the [examples folder](./examples).
---
## ✨ Features
- Ultra tiny (_0.9kb_) [![Minzipped size][bundlephobia-src]][bundlephobia-href]
- Elegant API
- Agnostic (Deno, Bun and NodeJS)
- Variety of styles and colors---
## 🎀 Styles and colors
_A clarification:_ the `.toString()` method is required to convert a string after applying colors and styles.
#### Colors are applied with the `.color()` method.
```ts
const text = style("hello world").color("red").toString(); // 'red' color
```And they are the following:
```ruby
# Colors:
black
red
green
yellow
blue
magenta
cyan
white
gray
grey# More vivid colors:
brightBlack
brightRed
brightGreen
brightYellow
brightBlue
brightMagenta
brightCyan
brightWhite
brightGray
brightGrey
```#### Each style has its own method.
```ts
const text = style("hello world").bold().toString(); // 'bold' style
```And they are the following:
```ruby
# Styles:
reset
bold
dim
italic
underline
inverse
hidden
strikethrough
```#### Background colors are applied with the `.bg()` method.
```ts
const text = style("hello world").bg("green").toString(); // 'green' background color
```---
## 📄 License
This project is licensed under the [MIT License](./LICENSE).
---
[bundlephobia-src]: https://badgen.net/bundlephobia/minzip/litecolor
[bundlephobia-href]: https://bundlephobia.com/result?p=litecolor