Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Standard Library Overview

Forge ships with 16 built-in modules containing over 230 functions. All modules are available without any import statement. There is no import math or require("fs") – every module is pre-loaded into the global scope.

Accessing Modules

Modules are accessed via dot notation:

let root = math.sqrt(144)       // 12.0
let data = fs.read("config.json")
let hash = crypto.sha256("hello")

Each module is a first-class object. You can assign it to a variable:

let m = math
say m.pi    // 3.141592653589793

Module Index

ModuleDescriptionFunctions
mathMathematical operations and constants17
fsFile system operations20
ioInput/output and command-line arguments6
cryptoHashing, encoding, and decoding6
dbSQLite database operations4
pgPostgreSQL database operations4
jsonJSON parsing and serialization3
csvCSV parsing and serialization4
regexRegular expression matching5
envEnvironment variables4
logStructured logging with timestamps4
termTerminal colors, formatting, and widgets25+
httpHTTP client and server decorators9
execExternal command execution1
timeDate, time, and timezone operations25
npcFake data generation for testing16

Execution Tier Support

All modules are fully supported in the interpreter (default execution mode). The bytecode VM (--vm) and JIT (--jit) support a subset of modules – primarily math, fs, io, and npc. For full module access, use the interpreter.