gleamunison/env

One environment read boundary.

Every process setting goes through envoy here instead of declaring its own external. The helpers preserve the established meaning: absent and empty both select a default, while boolean settings accept 1, true, or yes case-insensitively.

Values

pub fn flag(key: String) -> Bool

Established boolean setting: 1, true, or yes, case-insensitive.

pub fn get(key: String) -> Result(String, Nil)

Raw lookup. Absent is Error(Nil); an empty value is still present.

pub fn string_or(key: String, default: String) -> String

First non-empty value, else the default.

pub fn truthy(value: String) -> Bool

The same boolean rule applied to an already-read value.

✨ Search Document