@chromakit/core
    Preparing search index...

    Function banner

    • Draw a large, stylized banner headline for terminal output.

      Parameters

      Returns string

      A multi-line string suitable for printing to a terminal.

      • Width heuristic: The banner width is max(20, text.length + 8), ensuring at least 4 characters of padding per side for visual impact.
      • Style → color order: The style transform is applied first (e.g., bold, underline), then the foreground color (via colorText) is applied to both the lines and the styled text so colors remain consistent.
      • Graphemes: Width uses JavaScript text.length (code units). Complex graphemes (emoji/ZWJ/combining marks) may visually misalign. If precise alignment is required, consider segmenting into grapheme clusters and computing display width accordingly.
      • ANSI/SGR: Coloring relies on standard SGR sequences (e.g., 38;2;r;g;b for truecolor FG) and a trailing reset—widely supported on modern terminals and Windows VT. :contentReference[oaicite:0]{index=0}

      Basic usage with default style and cyan color:

      console.log(banner("ChromaKit", { color: "cyan" }));
      

      Custom character and no extra spacing:

      console.log(banner("Build OK", { char: "─", spacing: false }));