Skip to content

io ​

luau
local io = require("@std/io")

WARNING

These APIs are still open to future evolution. In new major versions, they may change in backwards incompatible ways.

Summary ​

EntryDescription
inputReads a line from standard input. If prompt is provided, it is written to stdout before waiting for input.
writeWrites one or more strings to standard output without a trailing newline.

Functions and Properties ​

io.input ​

Reads a line from standard input. If prompt is provided, it is written to stdout before waiting for input.

User input can be provided via command line stdin, piped input, or redirection from a file. See examples/user_input.luau.

luau
(prompt: string?) -> string

io.write ​

Writes one or more strings to standard output without a trailing newline.

luau
(...: string) -> ()