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

Download history 3/week @ 2024-12-07 1/week @ 2025-02-01 1/week @ 2025-02-08 9/week @ 2025-02-15 108/week @ 2025-02-22 30/week @ 2025-03-01 1/week @ 2025-03-08

148 downloads per month

MIT license

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