Standard Library Overview
REK comes with a focused standard library for common tasks. Import modules using the import keyword.
File System (fs)
Read and write files.
import fs
// Reading a file
let content = fs.read_to_string("data.txt")
log(content)
// Writing to a file
fs.write_string("output.txt", "Hello World")
Time
Utilities for time and duration.
import time
let start = time.now()
// Do some work...
let end = time.now()
log("Duration: " + (end - start))
time.sleep(1000) // Sleep for 1 second (milliseconds)
Environment (env)
Access environment variables and command line arguments.
import env
let path = env.get("PATH")
log(path)
// Setting a variable
env.set("MY_VAR", "123")