color-logger-browser
v1.0.3
Published
A browser console logger with color-coded messages
Maintainers
Readme
📦 Color Logger Browser
A lightweight and easy-to-use npm package for color-coded console logging in the browser.
Make your logs stand out in the cluttered console using background colors, text colors, and custom styles.
🚀 Installation
npm install color-logger-browser📖 Usage
import logger from "color-logger-browser";
// Predefined styles
logger.info("This is an info log");
logger.success("This is a success log");
logger.warn("This is a warning log");
logger.error("This is an error log");
// Custom style
logger.custom("Custom Color!", "pink", "black");🎨 Output Example
In the browser console:
- Info: Blue background with white text
- Success: Green background with white text
- Warning: Yellow background with black text
- Error: Red background with white text
- Custom: Any color combination you choose
📚 API Reference
| Method | Description | Example |
|--------------|------------------------------------------------------|---------|
| info(msg) | Logs an informational message in blue | logger.info("Hello") |
| success(msg)| Logs a success message in green | logger.success("Done!") |
| warn(msg) | Logs a warning message in yellow | logger.warn("Careful!") |
| error(msg) | Logs an error message in red | logger.error("Error!") |
| custom(msg, color, background) | Logs a message with custom colors | logger.custom("Note", "orange", "black") |
📝 License
MIT © 2025 Prince Verma
