Skip to Content
Skip to Content
API Reference<globals>

Globals


Globals are available in every module. The listed globals are modified by the zune backend, refer to the luau globals  for the rest of the globals.

Variables

zune

The global zune variable is a table that contains all the zune apis.

zune: <{ compiled: { optimize: number, debug: number, mode: "debug" | "release", }?, fs: FileSystemLib, process: ProcessLib, testing: TestingLib, task: TaskLib, net: NetworkLib, luau: LuauLib, serde: SerdeLib, io: IoLib, crypto: CryptoLib, regex: RegexLib, time: TimeLib, ffi: FFILib, sqlite: SQLiteLib, require: RequireLib, random: RandomLib, thread: ThreadLib, mem: MemLib platform: PlatformLib }table{ compiled: { optimize: number, debug: number, mode: "debug" | "release", }?, fs: FileSystemLib, process: ProcessLib, testing: TestingLib, task: TaskLib, net: NetworkLib, luau: LuauLib, serde: SerdeLib, io: IoLib, crypto: CryptoLib, regex: RegexLib, time: TimeLib, ffi: FFILib, sqlite: SQLiteLib, require: RequireLib, random: RandomLib, thread: ThreadLib, mem: MemLib platform: PlatformLib }>

_VERSION

_VERSION: string

The version of the Luau runtime. In zune, this should idealy be

zune <zune version>[-buildtag]+<luau version>

zune <major>.<minor>.<patch>[-buildtag]+<major>.<minor>

examples:

  • zune 0.1.0+0.640
  • zune 0.1.0-dev.1234567+0.640

The following code example shows how to detect if zune is running and provide the zune version with the Luau version.

detect_zune.luau
local pattern = "zune (%d+%.%d+%.%d+)%-?([%.%w%d]*)%+(%d+%.%d+)" local zuneVersion, buildTag, luauVersion = string.match(_VERSION, pattern) if (zuneVersion) then print(`zune Version: {zuneVersion}-{buildTag}`) print(`luau Version: {luauVersion}`) end

_FILE

The file information of the current running module. _FILE variable may not be available in all cases, such as executing luau in a custom environment.

_FILE: <{ main: boolean, }table{ main: boolean, }>

Functions

print

Writes formatted values to stderr. stderr is the default for debugging. To write into stdout, use io.stdout.

print(...any): ()

require

Luau require function, used to load modules.

Based on the Luau RFC .

examples:

  • require("./module")
  • require("@alias/module")
  • require("../module")
require(path: string): any

Throws

  • IO Error
  • Memory Error
  • Resolve Error
Last updated on