dotenv-proc

Crates.iodotenv-proc
lib.rsdotenv-proc
version0.1.0
created_at2025-01-15 22:56:25.686186+00
updated_at2025-01-15 22:56:25.686186+00
descriptionA simple proc-macro crate to use a .env file.
homepage
repositoryhttps://github.com/SCool62/dotenv
max_upload_size
id1518546
size14,736
(SCool62)

documentation

README

Dotenv

Small, proc-macro crate that bakes environment variables from a .env file into the compiled binary. The dotenv!() macro is used the same as the built-in env!() macro, and the dotenv_option!() macro is used the same as option_env!().

Usage

.env file

FOO=BAR

In rust:

const FOO = dotenv!("FOO");

dotenv!("FOO") will expand at compile time to a &'static str of whatever FOO is set to in the .env file (in this case "bar").

Commit count: 6

cargo fmt