Skip to Content
Skip to Content

Standard I/O

zune.io


A library to use standard input/output in luau.

Properties

stdout

stdout: FileHandle

stderr

stderr: FileHandle

stdin

stdin: FileHandle

Functions

format

Formats input to a readable string.

format(...any): string

Parameters

  • ...any - The values to format.

Throws

  • Memory Error

createBufferSink

Creates a buffer sink.

createBufferSink(opts: export type BufferSinkOptions = { limit: number?, size: number?, }BufferSinkOptionsexport type BufferSinkOptions = { limit: number?, size: number?, }?): BufferSink

Parameters

  • opts: BufferSinkOptions? - The options for the buffer sink.
    • limit: number? - The maximum amount of bytes allowed to be written to the buffer.
      • default: 1073741824
    • size: number? - The initial size of the buffer.
      • default: 0

Throws

  • Memory Error

createFixedBufferStream

Creates a buffer stream.

createFixedBufferStream(buffer: buffer): BufferStream

Parameters

  • buffer: buffer - The buffer to create the stream with.

Throws

  • Memory Error

Namespaces

terminal


PROPERTIES

isTTY

Whether the terminal is a TTY.

terminal.isTTY: boolean

FUNCTIONS

getCurrentMode

Get current saved mode.

terminal.getCurrentMode(): "normal" | "raw"

enableRawMode

Enable raw mode.

On unix: Will attempt to change terminal mode. On windows: Will attempt to change console mode.

returns true if the operation was successful.

terminal.enableRawMode(): boolean

restoreMode

Restores the terminal to the original mode.

On unix: Will attempt to restore the original terminal mode. On windows: Will attempt to restore the original console mode.

returns true if the operation was successful.

terminal.restoreMode(): boolean

getSize

Gets the terminal size.

Returns a tuple of (width, height). Otherwise returns (nil, nil) if current terminal is not a TTY.

terminal.getSize(): (number?, number?)

Throws

  • Terminal Error
Last updated on