Lamg.Env 0.6.0

dotnet add package Lamg.Env --version 0.6.0
                    
NuGet\Install-Package Lamg.Env -Version 0.6.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lamg.Env" Version="0.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lamg.Env" Version="0.6.0" />
                    
Directory.Packages.props
<PackageReference Include="Lamg.Env" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lamg.Env --version 0.6.0
                    
#r "nuget: Lamg.Env, 0.6.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lamg.Env@0.6.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lamg.Env&version=0.6.0
                    
Install as a Cake Addin
#tool nuget:?package=Lamg.Env&version=0.6.0
                    
Install as a Cake Tool

logo

.NET F# License: Apache2 NuGet Version NuGet Downloads Publish

Lamg.Env

F# library for environment/secret loading and result / taskResult computation expressions.

Install

dotnet add package Lamg.Env

Modules

Module Purpose
Lamg.Env.Result result and taskResult computation expressions
Lamg.Env.Secrets Built-in .env load + 1Password CLI (op)
Lamg.Env.Console Colored console helpers
Lamg.Env.Env Env vars (getEnv, requireEnv, …), IClock / SystemClock, and RFC3339 UTC helpers (toRFC3339…Z, nowRFC3339 clock). getEnv trims and returns None for blank values — do not trim or re-check emptiness after calling it.

Secrets

open Lamg.Env.Result
open Lamg.Env.Secrets

loadDotEnv ()

// Prefer local env; fall back to 1Password (same names as field labels)
let! secrets =
  resolveFromEnvOrOnePassword [ "API_KEY"; "API_SECRET" ] "my-vault" "my-item"

// Or always load from 1Password and map fields yourself
let! json = getItem "my-vault" "my-item" (Some [ "API_KEY" ])
let! fields = fieldsByLabel json
let apiKey = fields["API_KEY"]

Set OP_SERVICE_ACCOUNT_TOKEN (e.g. in .env) or use an interactive op signin session.

Computation expressions

open Lamg.Env.Result

let work = taskResult {
  let! a = Ok 1
  let! b = someAsyncWork ()
  return a + b
}

Develop

dotnet build Lamg.Env.slnx
dotnet run --project Lamg.Env.Tests
dotnet pack Lamg.Env/Lamg.Env.fsproj -c Release

License

Apache 2.0

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Lamg.Env:

Package Downloads
MigLib

Package Description

MigLib.Codegen

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.6.0 108 7/29/2026
0.5.1 72 7/29/2026
0.4.0 86 7/27/2026
0.3.1 91 7/23/2026
0.3.0 96 7/23/2026
0.2.0 99 7/22/2026
0.1.0 98 7/20/2026