The Standard Library
Lune has a comprehensive standard library that gives your scripts powerful capabilities. These libraries let you do everything from reading files, to making web requests, to running other programs.
Here are some of the most commonly used libraries:
fs
- Work with files and directoriesnet
- Make HTTP requests and create serversprocess
- Run external programs and access system informationstdio
- Get input from users and display outputtask
- Schedule and manage concurrent tasks
Importing Libraries
Section titled “Importing Libraries”Unlike Luau’s globals like math
or table
, Lune’s libraries need to be imported before you can use them. You do this with a special require
statement:
local fs = require("@lune/fs")local net = require("@lune/net")local process = require("@lune/process")
The @lune/
prefix tells Lune that you want to use one of its standard libraries rather than looking for a file in your project.
Throughout the rest of this book, we’ll explore these libraries in detail and see how they work together to make Lune scripts powerful and flexible.