Overview
What this package owns in the runtime
Config centralizes environment loading and validation so applications fail fast when required variables are missing or invalid. It exposes a typed ConfigService through DI and supports env-file loading plus optional prefixed variable mapping.
What it provides
- ConfigModule.register() and ConfigModule.registerAsync() provide synchronous and factory-driven bootstrap flows.
- Schema validation runs before traffic is served, so invalid env state fails startup early.
- InjectConfigService() and getConfigService() expose typed values inside DI-managed services.
- Prefix mapping can resolve logical keys from prefixed variables such as DB_HOST and DB_PORT.
How it fits
- Used across upstream samples to register NODE_ENV, PORT, and runtime tuning variables before CreateApplication().
- Fits naturally with @xtaskjs/core lifecycle because config validation runs before route handling begins.
- Pairs with @xtaskjs/security, @xtaskjs/typeorm, and other modules to centralize credentials and endpoint settings.