Lune's standard library✎
Files, networking, processes and the rest — as two nodes that know every signature.
Pending review
Lune ships its own library: the filesystem, HTTP, child processes, the terminal, a scheduler. Each part is a module you require — @lune/fs, @lune/net — and Roswaal knows all 61 of their functions.
Two nodes, not sixty-one
One node per function would put sixty-odd entries in the palette and a release of Roswaal between you and anything Lune shipped last month. So there are two, and they read a catalogue: Lune Function for a call that does something, Lune Function (Value) for one that answers something.
The palette still knows every function. Type readFile and fs.readFile is there; picking it places the node already set to that call, with path and the result pin typed from Lune's own signature.
Info
must_use is a value; the rest are steps. So fs.readFile is a value and fs.writeFile a step.The module has to be declared
A Lune Function node does not write its own require. Pick fs.readFile in a script that does not require @lune/fs and the node says so, and the Inspector offers a button that declares it.
Warning
@lune/fs is no exception, though it is always available: placing a node never adds a require. See Modules.So the button is the whole of the difference: said and offered, never done. Declaring it the moment you picked the call would be the editor expanding what your project depends on without being asked.
local fs = require("@lune/fs") print(fs.readFile("notes.txt"))
The local is the one you named in the Variables panel. Call it disk and the call reads disk.readFile — see Variables and locals for why the name is yours.
What is in it
| Module | What it is for | Functions |
|---|---|---|
@lune/datetime | Dates, times and their formats | 7 |
@lune/fs | The filesystem | 11 |
@lune/luau | Compiling and loading Luau at runtime | 2 |
@lune/net | HTTP, sockets and serving | 5 |
@lune/process | This process, and child processes | 3 |
@lune/regex | Regular expressions | 1 |
@lune/roblox | Roblox files, instances and datatypes | 14 |
@lune/serde | JSON, TOML, YAML and compression | 6 |
@lune/stdio | The terminal: input, output and colour | 7 |
@lune/task | The scheduler, and waiting | 5 |
A module also hands back types with methods of their own — regex.new gives you a Regex, and its find is asked of that value rather than of the module. Those are Call Method, not these two nodes.
Arguments and results
- Arguments arrive named and typed from Lune's signature, with Lune's own description on each pin.
- An optional argument starts empty, so leaving it alone leaves it off the call.
task.wait()andtask.wait(0)are different calls and you can write either. - A type Roswaal's pins cannot say —
buffer | string— becomes ananypin whose description gives the real one. A pin claimingstringwould refuse a buffer the runtime accepts.
Which Lune
Every signature here comes from Lune 0.10.5, read out of the types.d.luau files that ship with it rather than from a page describing them. Moving to a new Lune is npm run build:lune, and the diff is the API change — which is the point of generating it rather than writing it down.
Info
@lune/fs and its siblings cannot be aliased — Lune reserves those names. See Aliases and .luaurc for the ones you can define.Not reviewed yet