dotenv-typed 11.1.0

Zero-dependency .env file parser, variable interpolation engine, typed environment configuration loader, and secret-redacting Debug wrapper.
Documentation
  • Coverage
  • 100%
    13 out of 13 items documented0 out of 0 items with examples
  • Size
  • Source code size: 28.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 331.2 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1s Average build duration of successful builds.
  • all releases: 1s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates-dev/ctares
    2 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • vshengbro

dotenv-typed

Zero-Dependency .env Parser, Typed Config Loader & Secret Redaction

crates.io docs.rs Rust 2024 License: MIT

Workspace Overview · API Docs · Agent Engineering Rules


Overview

Provides a zero-dependency .env parser with quote/escape/interpolation support, layered EnvConfig typed extraction (bool, Duration, FromStr, lists, prefixes), and SecretString redaction in Debug/Display.

This package is part of the ctares unified Rust 2024 workspace and follows the repository's strict module purity, formatting, and dependency-ordered release standards.

Installation & Quick Start

cargo add dotenv-typed
use dotenv_typed::*;

let cfg: EnvConfig = EnvConfig::from_dotenv_str("PORT=8080\nDEBUG=true\n").expect("valid env");
assert_eq!(cfg.parse_or::<u16>("PORT", 3000).expect("port"), 8080);
assert!(cfg.get_bool_or("DEBUG", false).expect("bool"));

License

This project is licensed under the MIT License. See the LICENSE file for details.