load-dotenv 0.1.2

This is a small procedural macro to load your .env file at compile time
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented1 out of 3 items with examples
  • Size
  • Source code size: 3.44 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 245.91 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • davidpdrsn/load-dotenv
    7 5 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • davidpdrsn

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