Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 1.56 KB

lua-api.md

File metadata and controls

25 lines (20 loc) · 1.56 KB

📖 Lua API reference

Every built-in module is available with require. Each module has its own page below, carrying its full API and a runnable example of every capability.

Modules

Module What you get
🌐 http Web server and client, routing, middleware, WebSockets, and static file serving
🔌 socket Network client and server connections
⏳ async Background tasks, timers, and awaitable promises
📁 fs Read and write files, check what already exists
🔐 crypto Hashing, signatures, and secure random data
🧾 json Encode and decode JSON with a full Lua mapping
🧬 xml Encode and decode XML with a full Lua mapping
🗜️ zip Create, extract, and list archives
🧩 ffi Call functions from native libraries
🖥️ platform System, architecture, processor, and path information
⚙️ process Run commands and read the environment, working directory, and arguments
🕒 datetime Parse, format, and do calendar arithmetic on instants, with ISO-8601 and fixed offsets
📝 log Leveled logging with debug, info, warn, and error

The arg global

The host sets arg to the command-line arguments (the script path and its parameters). In the browser build it is usually empty.