Styled console logs made simple - a cute visual wrapper for your console logging with fun themes and custom styles! 🎉
- Pretty themed logs: info, success, warn, error
- Easy custom styles for your logs
- Simple API for quick & delightful debugging
npm install @kaehehehe/visual-console
# or
yarn add @kaehehehe/visual-console
# or
pnpm add @kaehehehe/visual-consoleimport vc from "@kaehehehe/visual-console"
// Logs with theme
vc.log("✅ Success log!", { theme: "success" });
vc.info("💡 Info log!", { theme: "info" });
vc.warn("⚠️ Warning log!", { theme: "warn" });
vc.error("🚨 Error log!", { theme: "error" });// Custom colorful log 💜
vc.log("Custom styled log 💖", {
style: {
color: "#FF00FF",
background: "#FFF0FF",
padding: "5px 10px",
borderRadius: "5px",
},
});| Method | What it does | Params |
|---|---|---|
log |
Basic log | (text: string, options?: { theme?: LogLevel, style?: ConsoleStyle }) |
info |
Info level log | (text: string, options?: { theme?: LogLevel, style?: ConsoleStyle }) |
warn |
Warning level log | (text: string, options?: { theme?: LogLevel, style?: ConsoleStyle }) |
error |
Error level log | (text: string, options?: { theme?: LogLevel, style?: ConsoleStyle }) |
assert |
Conditional assert log | (text: string, options?: { theme?: LogLevel, style?: ConsoleStyle }) |
group |
Start a group in console | (text: string, options?: { theme?: LogLevel, style?: ConsoleStyle }) |
groupCollapsed |
Start a collapsed group | (text: string, options?: { theme?: LogLevel, style?: ConsoleStyle }) |
- This library uses process.env.NODE_ENV to detect the environment and disable console logs in production.
- Make sure your build tool (e.g., Vite, Webpack, etc.) properly sets process.env.NODE_ENV to "production" when creating production bundles.
- If NODE_ENV is not set correctly, console logs may still appear in your production code.
- Most modern bundlers automatically handle this, but double-check your build configuration to ensure dead code elimination works as expected.
- For best results, run your production build command with environment variables properly configured, for example:
NODE_ENV=production vite build
