Package Exports
- @breadstone/archipel-platform-configuration
- @breadstone/archipel-platform-configuration/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@breadstone/archipel-platform-configuration) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@breadstone/archipel-platform-configuration
Type-safe configuration management with strategy-based resolution for NestJS applications.
Features
- Typed config keys – Compile-time type safety via
IConfigKey<T>andcreateConfigKey<T>(). - Strategy pattern – Swap configuration sources (environment variables,
.envfiles, custom) without changing consumers. - Global NestJS module –
ConfigModule.forRoot()bootstraps a globalConfigService;ConfigModule.register()declares per-library config entries. - Central registry –
ConfigRegistrycollects all registered keys for discovery and validation.
Quick Start
import { ConfigModule, EnvironmentConfigStrategy } from '@breadstone/archipel-platform-configuration';
@Module({
imports: [
ConfigModule.forRoot({
strategyFactory: () => new EnvironmentConfigStrategy(),
}),
],
})
export class AppModule {}Defining Config Keys
import { createConfigKey } from '@breadstone/archipel-platform-configuration';
export const DATABASE_URL = createConfigKey<string>('DATABASE_URL');
export const CACHE_TTL = createConfigKey<number>('CACHE_TTL');Registering Library Entries
ConfigModule.register('my-library', [
{ key: DATABASE_URL, required: true, description: 'PostgreSQL connection string' },
{ key: CACHE_TTL, required: false, defaultValue: 3600, description: 'Cache TTL in seconds' },
]);