<div align="center">
<img src="https://devhub.vip/pages/docs/img/logo.png" alt="dotenv-typed logo" height="120">
# dotenv-typed
**Zero-Dependency `.env` Parser, Typed Environment Config Loader & Redacting `SecretString`**
[](https://crates.io/crates/dotenv-typed)
[](https://docs.rs/dotenv-typed)
[](https://github.com/crates-dev/ctares/actions/workflows/rust.yml)
[](https://www.rust-lang.org)
[](../LICENSE)
[Workspace Overview](../README.md) ยท [API Docs](https://docs.rs/dotenv-typed/latest/)
</div>
---
## Overview
`dotenv-typed` parses `.env` files with interpolation and escape handling into a layered, prefix-scoped `EnvConfig` supporting typed scalars, durations, lists, and redacting `SecretString` values with zero external dependencies.
## Installation
```sh
cargo add dotenv-typed
```
## Usage
```rust
use dotenv_typed::EnvConfig;
let raw = "APP_HOST=127.0.0.1\nAPP_PORT=8080\nAPP_ENABLED=true\n";
let config = EnvConfig::from_dotenv_str(raw).unwrap().with_prefix("APP_");
assert_eq!(config.get("HOST"), Some("127.0.0.1"));
assert!(config.get_bool_or("ENABLED", false).unwrap());
```
## Verification
```sh
cargo run -p crate-cli -- fmt --check
cargo clippy -p dotenv-typed --all-features --all-targets -- -D warnings
cargo test -p dotenv-typed --all-features
```
## License
This project is licensed under the MIT License. See the [LICENSE](../LICENSE) file for details.
## Contact
For inquiries, please contact the author at [root@devhub.vip](mailto:root@devhub.vip).