JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1258
  • Score
    100M100P100Q128654F
  • License MIT

Type-safe configuration management with strategy-based resolution for NestJS applications.

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> and createConfigKey<T>().
  • Strategy pattern – Swap configuration sources (environment variables, .env files, custom) without changing consumers.
  • Global NestJS moduleConfigModule.forRoot() bootstraps a global ConfigService; ConfigModule.register() declares per-library config entries.
  • Central registryConfigRegistry collects 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' },
]);