Modules Reference
internal:array Native and WASM
Section titled “internal:array ”Utilities for array manipulation, querying, and transformations.
arr.len(array)arr.push(array, items...)arr.pop(array)arr.first(array)arr.last(array)arr.reverse(array)arr.join(array, separator)arr.contains(array, value)arr.sum(array)arr.avg(array)
internal:fs Native
Section titled “internal:fs ”File system operations like reading, writing, listing, and moving paths.
fs.cwd()fs.chdir(path)fs.exists(path)fs.read_file(path)fs.write_file(path, content)fs.append_file(path, content)fs.list_dir(path?)fs.mkdir(path)fs.remove(path)fs.rename(from, to)fs.copy(from, to)
internal:hash Native and WASM
Section titled “internal:hash ”Hashing and encoding helpers such as SHA-256, HMAC, hex, and base64.
hash.sha256(input)hash.hmac_sha256(key, message)hash.base64_encode(input)hash.base64_decode(input)hash.hex_encode(input)hash.hex_decode(input)
internal:http Native
Section titled “internal:http ”HTTP client helpers for requests and response inspection.
http.get(url, timeout_ms?)http.delete(url, timeout_ms?)http.post(url, body, content_type?, timeout_ms?)http.put(url, body, content_type?, timeout_ms?)http.patch(url, body, content_type?, timeout_ms?)http.request(method, url, body?, content_type?, timeout_ms?)http.status(response)http.ok(response)http.text(response)http.body(response)
internal:math Native and WASM
Section titled “internal:math ”Mathematical constants and numeric operations for calculations.
math.pi()math.e()math.tau()math.abs(n)math.sqrt(n)math.cbrt(n)math.pow(base, exp)math.min(...)math.max(...)math.floor(n)math.ceil(n)math.round(n)math.trunc(n)math.sin(n)math.cos(n)math.tan(n)math.asin(n)math.acos(n)math.atan(n)math.atan2(y, x)math.sinh(n)math.cosh(n)math.tanh(n)math.exp(n)math.ln(n)math.log(n, base)math.log10(n)math.log2(n)math.random()math.eval(value)
internal:random Native and WASM
Section titled “internal:random ”Pseudo-random value generation with optional deterministic seeding.
random.float()random.bool()random.seed(seed)random.int(min, max)random.choice(array)random.shuffle(array)
internal:server Native
Section titled “internal:server ”Lightweight HTTP server utilities for local routing and responses.
new Server()server.defineRoute(path, handlerFn)server.defineRoutes(path, handlerFn)server.listen(port)server.serve(port)server.wait()server.stop()server.stop_all()server.running()server.address()server.url()server.start(port, body?, status?, content_type?)
Connection helpers inside handlers:
connection.reply(body)connection.status(code)connection.contentType(type)
internal:string Native and WASM
Section titled “internal:string ”String manipulation helpers for casing, slicing, matching, and replacement.
str.len(s)str.upper(s)str.lower(s)str.trim(s)str.split(s, delimiter)str.replace(s, from, to)str.contains(s, needle)str.starts_with(s, prefix)str.ends_with(s, suffix)str.repeat(s, n)str.reverse(s)str.chars(s)
internal:system Native and WASM
Section titled “internal:system ”Runtime and environment information such as time, args, and platform.
sys.time()sys.time_ms()sys.args()sys.env(key)sys.platform()sys.arch()
internal:uuid Native and WASM
Section titled “internal:uuid ”UUID generation helpers for versions 1, 4, 6, and 7.
uuid.v1()uuid.v4()uuid.v6()uuid.v7()