load-dotenv

Crates.ioload-dotenv
lib.rsload-dotenv
version0.1.2
sourcesrc
created_at2019-02-15 14:39:10.044024
updated_at2021-01-04 11:13:17.814442
descriptionThis is a small procedural macro to load your .env file at compile time
homepagehttps://github.com/davidpdrsn/load-dotenv
repositoryhttps://github.com/davidpdrsn/load-dotenv.git
max_upload_size
id114974
size3,448
David Pedersen (davidpdrsn)

documentation

https://docs.rs/load-dotenv

README

load-dotenv

This is a small procedural macro to load your .env file at compile time. That way you can use std::env! to load environment variables and fail the build if a variable is missing.

All it does is call the dotenv crate.

Example

.env file:

KEY=value

Rust:

use load_dotenv::load_dotenv;

load_dotenv!();

fn main() {
    assert_eq!("value", env!("KEY"));
}

License: MIT

Commit count: 7

cargo fmt