Press F12 to open DevTools Console
Press F12 to open DevTools Console

Installation

npm install @dragorww/console-style

Usage

            
import { console$, style } from '@dragorww/console-style';

// Define styles
const purple = style({ color: '#8B5CF6' });
const orange = style({ color: '#F97316' });
const gray = style({ color: '#94A3B8' });

// ASCII art with styled parts
console$(style({})`
  ${purple`  ╭─< CSS-in-JS for Console >─╮`}
  ${orange`  │ █▀▀ █▀█ █▄░█ █▀ █▀█ █     │`}
  ${orange`  │ █▄▄ █▄█ █░▀█ ▄█ █▄█ █▄▄   │`}
    ${gray`  │ ▔▔▔ $ T Y L E ▔▔▔ v1.0    │`}
  ${purple`  ╰───────────────────────────╯`}
`);

// Simple colored text
console$(style({ color: 'red' })`Error: Something went wrong`);

// Multiple styles composition
console$([
  style({ color: 'blue', fontWeight: 'bold' })`Info:`,
  style({ color: 'gray' })` Operation completed successfully`
]);
        
    

Features

  • 🎨 CSS-like styling for console output
  • 💅 Template literals syntax
  • 🚀 Lightweight and zero dependencies
  • 📦 Works in all modern browsers