@karthikn2510/console-colors
v1.0.1
Published
Chainable console color logger like chalk
Maintainers
Readme
@karthikn2510/console-colors 🎨
A lightweight, chainable console color and style helper (inspired by chalk).
Supports CommonJS, ESM, and TypeScript out of the box.
🚀 Installation
npm install @karthikn2510/console-colors
Usage
CommonJS
js
Copy
Edit
const { log } = require("@karthikn2510/console-colors");
log.red("Error message");
log.green.bold("Success!");
log.yellow.underline("Warning!");
log.green.bold("Success message");
log.bgRed.white.bold("Critical Error!"); // White text on red background
log.bgYellow.red("Warning!"); // Red text on yellow background
log.bgBlue.bold("Info log"); // Bold text on blue background
ES Modules
js
Copy
Edit
import { log } from "@karthikn2510/console-colors";
log.blue("Info message");
log.magenta.bold.underline("Important Notice!");
TypeScript
ts
Copy
Edit
import { log } from "@karthikn2510/console-colors";
log.cyan("Hello, TypeScript!");
log.red.bold("Critical error!");
🎨 Available Styles
Colors: red, green, yellow, blue, magenta, cyan, white, gray
Formats: bold, underline, italic, strikethrough
All styles are chainable:
js
Copy
Edit
log.red.bold.underline("Critical Error!");
📦 Features
✅ Chainable API (like chalk)
✅ Works with CommonJS and ES Modules
✅ Full TypeScript support
✅ Lightweight (no dependencies)
🔧 Development
Clone and build:
sh
Copy
Edit
git clone https://github.com/karthikn2510/console-colors.git
cd console-colors
npm install
npm run build
📝 License
MIT © 2025 Karthikeyan Pitchaiya