Crate stupid_simple_dotenv
source · [−]Expand description
Reads key value pairs from an .env or any other file and stores them as easily available environment variables. Since dotenv is no longer maintained, this is an simpler smaller alternative.
Example
use stupid_simple_dotenv::to_env;
fn main() {
to_env().ok();
println!("Hello, {}!", std::env::var("myuser").unwrap());// in .env file: myuser=world
}
Functions
Reads named file stores the key value pairs as environment variables.
Reads key value pairs from a file and returns a vector of tuples.
Try to get the value of an environment variable.
If the variable is not present in the environment,
default
is returned.Reads .env file stores the key value pairs as environment variables.