5 releases (breaking)
Uses new Rust 2024
0.5.0 | Feb 25, 2025 |
---|---|
0.4.0 | Oct 26, 2024 |
0.3.0 | Oct 13, 2024 |
0.2.0 | Oct 7, 2024 |
0.1.0 | Sep 27, 2024 |
#409 in Configuration
148 downloads per month
9KB
104 lines
Dotenv+
A dotenv solution for Rust.
Quick Start
Write the environment variables in the env files and access them later using the var
function:
KEY=value
use dotenv_plus::{
DotEnv,
var,
};
DotEnv::new().run();
assert_eq!(var("RUST_ENV"), "production");
assert_eq!(var("KEY"), "value");
# By default, `RUST_ENV` is set to `development`
RUST_ENV=production cargo run
License
This project is licensed under the terms of the MIT license.
lib.rs
:
Dotenv+
A dotenv solution for Rust.
Quick Start
Write the environment variables in the env files
and access them later using the var
function:
KEY=value
use dotenv_plus::{
DotEnv,
var,
};
DotEnv::new().run();
assert_eq!(var("RUST_ENV"), "production");
assert_eq!(var("KEY"), "value");
# By default, `RUST_ENV` is set to `development`
RUST_ENV=production cargo run
Dependencies
~48KB