Built-in standard input / output & utility functions
Example usage
local stdio = require("@lune/stdio")
-- Prompting the user for basic input
local 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/error
stdio.write("Hello, ")
stdio.write("World! ")
stdio.write("All on the same line")
stdio.ewrite("\nAnd some error text, too")
Functions
color
function Stdio.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
function Stdio.ewrite(s: string)
Writes a string directly to stderr, without any newline.
format
function Stdio.format(_: ...any)
Formats arguments into a human-readable string with syntax highlighting for tables.