How cymondez/nest-simple-config works
NestJS Simple Config builds a hierarchical configuration object from files, environment variables and command-line arguments, then exposes immutable keyed reads and typed, validated option sections to a NestJS application. The documented priority is command line over environment over files; the builder also supports YAML, optional files and secret-backed configuration. A separate secret-management capability maps safe account references to OS-managed secrets and provides CLI operations. The graph preserves these documented branches; source excerpts are partial, so edges not explicit in excerpts rely on README or SOURCE INDEX evidence.
Main entry points: config-builder.ts Provider builder · config-provider.abstract.ts Provider contract · simple-config.module.ts Config module · config-options.module.ts Typed option binding
Components 20
Configuration assembly
- Config module
lib/simple-config.module.ts - Provider builder
lib/config-builder.ts - Merged config
lib/config-builder.ts
Configuration sources
- Provider contract
lib/config-providers/config-provider.abstract.ts - File provider
lib/config-providers/file-config-provider.ts - JSON / YAML loaders
lib/config-providers/json-config-provider.ts - Environment provider
lib/config-providers/env-config-provider.ts - Command-line provider
lib/config-providers/commandline-config-provider.ts - Default provider
lib/config-providers/default-config-provider.ts - Secret config provider
lib/config-providers/secret-config-provider.ts
Application access
- Configuration service
lib/simple-config.service.ts - Typed option binding
lib/config-options.module.ts - Option decorator
lib/decorators/bind-option.decorator.ts - Validation error
lib/exceptions/config-validate-exception.ts
Secret management
- Secret store
lib/secret-store.ts - OS keytar adapter
lib/keytar-secret-store.ts - Secret management CLI
lib/secrets-cli.ts
Other components
- NestJS app
- OS secret manager
- Application service
Connections 26
- NestJS app → Config module: configures
README.md - Config module → Provider builder: assembles
lib/simple-config.module.ts - Provider builder → Provider contract: loads providers
lib/config-builder.ts - Provider builder → Merged config: builds
lib/config-builder.ts - File provider → Provider contract: implements
lib/config-providers/file-config-provider.ts - JSON / YAML loaders → File provider: uses file loading
lib/config-providers/json-config-provider.ts - Environment provider → Provider contract: implements
lib/config-providers/env-config-provider.ts - Command-line provider → Provider contract: implements
lib/config-providers/commandline-config-provider.ts - Default provider → Provider contract: implements
lib/config-providers/default-config-provider.ts - Secret config provider → Provider contract: implements
- Provider builder → File provider: registers
lib/config-builder.ts - Provider builder → Environment provider: registers
lib/config-builder.ts - Provider builder → Command-line provider: registers
README.md - Provider builder → Secret config provider: supports
- Config module → Configuration service: provides
lib/simple-config.module.ts - Configuration service → Merged config: reads
lib/simple-config.service.ts - Application service → Configuration service: reads keys
README.md - Config module → Typed option binding: registers
lib/simple-config.module.ts - Typed option binding → Configuration service: reads section
lib/config-options.module.ts - Typed option binding → Option decorator: reads metadata
lib/config-options.module.ts - Typed option binding → Validation error: reports invalid config
- Secret config provider → Secret store: resolves secrets
- Secret management CLI → Secret store: manages secrets
- OS keytar adapter → OS secret manager: stores secrets
- Secret store → OS keytar adapter: adapts via
- NestJS app → Secret management CLI: runs
README.md