A correct dotenv library with variable substitution.
- Variable substitution:
$VAR,${VAR},${VAR:-default} - Three quote styles (`' " ``), multi-line values
- Overwrite or preserve existing environment variables
exportprefix for shell compatibility
Note: The crate is named
dotenvs, but its lib isdotenv.
[dependencies]
dotenvs = "0.2"dotenv::load().ok();
// iterate all variables
for (key, value) in dotenv::vars() {
println!("{}: {}", key, value);
}