just-color-it
Version:
A lightweight, zero-dependency Node.js library for adding colors to your terminal output. Supports both CommonJS and ES modules.
67 lines (44 loc) • 1.65 kB
Markdown
# just-color-it
A lightweight, zero-dependency Node.js library for adding colors to your terminal output. Supports both CommonJS and ES modules.
## Installation
```bash
npm install just-color-it
```
## Quick Start
### ES Modules
```javascript
import { red, green, yellow, danger, success, warn } from "just-color-it";
console.log(red("Error message"));
console.log(green("Success message"));
console.log(yellow("Warning message"));
```
### CommonJS
```javascript
const color = require("just-color-it");
console.log(color.red("Error message"));
console.log(color.green("Success message"));
console.log(color.yellow("Warning message"));
```
## Available Colors
| Function | Alias | Color | Use Case |
| ---------- | ----------- | ------ | ------------------------------- |
| `red()` | `danger()` | Red | Errors, critical messages |
| `green()` | `success()` | Green | Success messages, confirmations |
| `yellow()` | `warn()` | Yellow | Warnings, deprecation notices |
## Custom Colors
```javascript
import { wrap } from "just-color-it";
const blue = wrap(34);
console.log(blue("This is blue text"));
```
## Features
- 🎨 Simple and intuitive API
- 📦 Zero dependencies
- 🔄 Dual module support (CommonJS & ES modules)
- 🚀 Lightweight (~0.5KB)
- 🛠️ Extensible with custom colors
## Full Documentation
For complete documentation, examples, API reference, and more advanced usage, visit:
**📖 [Full Documentation on GitHub](https://github.com/itsaryanchauhan/just-color-it#readme)**
## License
ISC