Built-in standard input / output & utility functions
Example usage
local stdio =require("@lune/stdio")-- Prompting the user for basic inputlocal text: string = stdio.prompt("text", "Please write some text")local confirmed: boolean = stdio.prompt("confirm", "Please confirm this action")-- Writing directly to stdout or stderr, without the auto-formatting of print/warn/errorstdio.write("Hello, ")stdio.write("World! ")stdio.write("All on the same line")stdio.ewrite("\nAnd some error text, too")
Functions
color
functionStdio.color(color:Color)
Return an ANSI string that can be used to modify the persistent output color.
Pass "reset" to get a string that can reset the persistent output color.
Example usage:
stdio.write(stdio.color("red"))print("This text will be red")stdio.write(stdio.color("reset"))print("This text will be normal")
ewrite
functionStdio.ewrite(s:string)
Writes a string directly to stderr, without any newline.
format
functionStdio.format(_:...any)
Formats arguments into a human-readable string with syntax highlighting for tables.