legion-fmt

String formatting and template utilities. Printf-style formatting, table output, color codes, and structured text helpers.

v1.0.3 MIT @legionhjyu Updated NaNy ago
Install
legion pkg install legion-fmt

legion-fmt

String formatting and pretty-print utilities for legionhjyu.

Install

legion pkg install legion-fmt

Usage

summon "legion-fmt" release fmt

fmt.printf("Hello, %s! You have %d messages.\n", name, count) fmt.table(headers, rows) fmt.red("Error: something went wrong") fmt.green("Success!")

Functions

FunctionDescription
fmt.printf(tmpl, ...args)Printf-style formatted print
fmt.sprintf(tmpl, ...args)Returns formatted string
fmt.table(headers, rows)Prints aligned ASCII table
fmt.red(msg)Red terminal output
fmt.green(msg)Green terminal output
fmt.yellow(msg)Yellow terminal output
fmt.blue(msg)Blue terminal output
fmt.bold(msg)Bold terminal output