Bodu.Text.DotEnv
1.0.0
dotnet add package Bodu.Text.DotEnv --version 1.0.0
NuGet\Install-Package Bodu.Text.DotEnv -Version 1.0.0
<PackageReference Include="Bodu.Text.DotEnv" Version="1.0.0" />
<PackageVersion Include="Bodu.Text.DotEnv" Version="1.0.0" />
<PackageReference Include="Bodu.Text.DotEnv" />
paket add Bodu.Text.DotEnv --version 1.0.0
#r "nuget: Bodu.Text.DotEnv, 1.0.0"
#:package Bodu.Text.DotEnv@1.0.0
#addin nuget:?package=Bodu.Text.DotEnv&version=1.0.0
#tool nuget:?package=Bodu.Text.DotEnv&version=1.0.0
Bodu.Text.DotEnv
API stability — Stable. The public API surface is committed; breaking changes are reserved for a major-version bump per SemVer.
A DotEnv (.env) library for .NET 8, shaped after System.Text.Json: a typed settings serializer over a low-level forward-only token reader and writer, with both a mutable and a read-only document object model. The dialect follows the mainstream dotenv implementations — export prefixes, double/single quoting with escapes, inline comments — and values are deliberately literal: no ${VAR} interpolation happens at parse time.
Installation
dotnet add package Bodu.Text.DotEnv
Targets net8.0. Also available through the Bodu.Text.Formats umbrella package.
API shape
| Type(s) | Namespace | Role |
|---|---|---|
DotEnvSerializer / DotEnvSerializerOptions / DotEnvSerializerDefaults |
Bodu.Text.DotEnv |
Static serializer entry point, configuration, and presets (Web = SCREAMING_SNAKE_CASE, case-insensitive). |
DotEnvFormatException / DotEnvSerializationException |
Bodu.Text.DotEnv |
Failures split by cause: malformed input vs. values that cannot be mapped. |
Utf8DotEnvReader (+ DotEnvReaderOptions) |
Bodu.Text.DotEnv.Reader |
Forward-only ref struct token reader (export detection, quoting, inline comments). |
Utf8DotEnvWriter (+ DotEnvWriterOptions) |
Bodu.Text.DotEnv.Writer |
Forward-only ref struct token writer. |
DotEnvDocument / DotEnvElement / DotEnvProperty |
Bodu.Text.DotEnv.Document |
Read-only document object model over the flat key/value object. |
DotEnvNode / DotEnvObject / DotEnvValue |
Bodu.Text.DotEnv.Nodes |
Mutable document object model; preserves each entry's export flag. |
using Bodu.Text.DotEnv;
sealed class Settings
{
public string? AppEnv { get; set; } // binds APP_ENV
public int AppPort { get; set; } // binds APP_PORT
}
Settings settings = DotEnvSerializer.Deserialize<Settings>(
envText, new DotEnvSerializerOptions(DotEnvSerializerDefaults.Web));
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Bodu.Core (>= 1.0.0)
- Bodu.Text.Serialization (>= 1.0.0)
-
net8.0
- Bodu.Core (>= 1.0.0)
- Bodu.Text.Serialization (>= 1.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Bodu.Text.DotEnv:
| Package | Downloads |
|---|---|
|
Bodu.Text.Formats
Umbrella package for the Bodu line-oriented text formats on .NET 8 — delimited text (RFC 4180 CSV/TSV), DotEnv, and INI. References Bodu.Text.Delimited, Bodu.Text.DotEnv, and Bodu.Text.Ini, each a System.Text.Json-shaped library with a ref-struct Utf8 reader/writer pair, a serializer, a mutable node DOM, and a read-only document DOM. |
GitHub repositories
This package is not used by any popular GitHub repositories.