method
Os.env_or
Os.env_or(name, fallback) -> string
Reads an environment variable, returning fallback when it is not set — the null-safe way to read optional configuration. The result is always non-null, so it is safe to use directly.
Parameters
namethe variable namefallbackthe value to use when the variable is unsetExample
program EnvOr {
entry {
let assets = Os.env_or("LUDIC_ASSETS", "assets/")
print(len(assets))
}
}