EnvFile Module
.env file operations: reading, comparing, masking, editing.
Types
| Type | Description |
|
A single entry in a .env file section |
|
|
A section of entries in a .env file, grouped under a header |
Functions and values
| Function or value |
Description
|
|
|
Full Usage:
defaultSections groupedDefs values
Parameters:
(string * ConfigVarDef array) array
values : Map<string, string>
Returns: EnvFileSection array
|
Build EnvFileSection array from grouped config var definitions and current values Groups with empty name become "Other". Uses Doc.Description as comment if non-empty. Missing values default to empty string.
|
Full Usage:
displayChanges changes
Parameters:
(string * string * string) array
|
Display config changes in a user-friendly format
|
Full Usage:
maskValue key value
Parameters:
string
value : string
Returns: string
|
Mask sensitive values for display (shows first 4 chars, rest as asterisks)
|
Full Usage:
missingEntriesHeader defs values
Parameters:
ConfigVarDef array
values : Map<string, string>
Returns: string list
|
Generate comment lines summarizing missing required config entries. Returns empty list when nothing is missing.
|
Full Usage:
openInEditor editor path
Parameters:
string
path : string
|
Open a file in the given editor command
|
|
Read a .env-style configuration file into a Map Ignores comments (lines starting with #) and empty lines
|
Full Usage:
secretKeyIndicators
Returns: string[]
|
Secret key indicators for masking sensitive values in output
|
Full Usage:
writeEnvFile path headerLines sections
Parameters:
string
headerLines : string list
sections : EnvFileSection array
|
Write a sectioned .env file with optional header lines and sections Header lines are written as-is before sections. Each section gets a `# === Header ===` header line.
|
UnionConfig