env

fun env(name: String): String

Returns the value of an environmental variable, loading from a .env file in the current working directory if possible.

This function caches the contents of the .env file the first time it's called - there's no way to parse the file again later.

This function will throw an exception if the environmental variable can't be found.

Return

The value of the environmental variable.

Parameters

name

Environmental variable to get the value for.

Throws

Thrown if the environmental variable can't be found.