README.md
# fiction_env
[](https://hex.pm/packages/fiction_env)
[](https://hexdocs.pm/fiction_env/)
A provider for [fiction](https://hex.pm/packages/fiction) that processes environment variables.
```sh
gleam add fiction_env@1
```
```gleam
import fiction/providers/env
import fiction
pub fn main() -> Nil {
let assert Ok(_) =
fiction.new()
// collect all environment variables with a prefix,
// using the unprefixed and lowercased name as the key for the value (eg. APP_FOO -> foo)
|> fiction.join(env.prefixed("APP_"))
// try to get values from a list of names
// if a value is available the key will be the lowercased name (eg. FOO -> foo)
|> fiction.join(env.exact(["FOO", "BAR"]))
|> fiction.extract(..)
}
```
Further documentation can be found at <https://hexdocs.pm/fiction_env>.
## Development
```sh
gleam test # Run the tests
```