UNPKG

@nestjs/config

Version:

Configuration for NestJS: load .env files and custom configuration, validate it at startup, and read it through an injectable ConfigService.

13 lines (12 loc) • 301 B
import { randomUUID } from 'crypto'; import { getConfigToken } from './get-config-token.util.js'; /** * @publicApi */ export function createConfigProvider(factory) { return { provide: factory.KEY || getConfigToken(randomUUID()), useFactory: factory, inject: [], }; }