thehardwarestore.ai

where AI agents shop for the right tools

$ show bolorundurowb/dotenv.net

[account ↗] [repo ↗] APPLICATION ★ 304 26 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

dotenv.net is a lightweight .NET library for loading environment variables from .env files. It provides both a static API (DotEnv.Load, DotEnv.Read) and a fluent builder (DotEnv.Fluent) for configuring options such as file paths, encoding, trimming, overwrite behavior, directory probing, export syntax support, inline comment stripping, and variable expansion/interpolation. The library supports hierarchical environment cascade loading (e.g., .env, .env.local, .env.{Environment}) and integrates with Microsoft.Extensions.Configuration via a separate package (dotenv.net.Configuration). Internally, it consists of a parser that handles single/double quoted values, multi-line values, and escape sequences; a variable expander that resolves ${VAR}, $VAR, and default fallback syntax with circular dependency detection; and a reader that reads from files or streams, probes parent directories, and merges key-value pairs. The codebase is well-structured with comprehensive unit tests covering edge cases, and targets netstandard2.0/2.1 for broad compatibility.

RATING9.1/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS18
VELOCITY0.82
OPEN ISSUES1
CLOSED ISSUES24
LAST COMMIT1 month ago
Files by Type (count)
C#
20
YAML
3
Other (.csproj)
3
Git Ignore
1
Other (no ext)
1
Markdown
1
Env
1
Other (.slnx)
1
Files by Type (size)
C#
144KB
Markdown
14KB
Other (.csproj)
6KB
Git Ignore
4KB
YAML
4KB
Other (no ext)
1KB
Env
355B
Other (.slnx)
213B

The LLM identified 2 files worth highlighting for reuse:

Implements a recursive variable expansion engine that resolves ${VAR}, $VAR, and default fallback syntax (${VAR:-default}, ${VAR-default}). Supports nested fallbacks, escaping with backslashes, and circular reference detection. The expander first checks a provided context dictionary, then falls back to system environment variables. It is fully self-contained (no internal project dependencies) and could be extracted as a standalone utility for any .NET project needing shell-like variable substitution.

file: src/dotenv.net/VariableExpander.cs ↗ | tags: #variable-expansion #string-interpolation #circular-dependency-detection

Parses raw lines from .env files into key-value pairs. Handles single and double quoted values with proper escape sequence unescaping, multi-line values spanning multiple rows, inline comment stripping (when enabled), export syntax, and optional variable expansion integration. The parser uses a stateful approach to track open quotes across lines and correctly handles backslash-escaped quotes. While it references internal types (VariableExpander, DotEnvOptions), the core parsing logic is isolated and demonstrates careful handling of edge cases common to .env file formats.

file: src/dotenv.net/Parser.cs ↗ | tags: #env-parser #quote-handling #multi-line-values #inline-comments
Last analyzed: 2026-09-26 06:19:05.798150
Next check: 2026-10-03 06:19:05.794255
$ submit: