Handles environment variable configuration with validation and defaults
// Source: https://github.com/nitrocloudofficial/nitrostack | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import 'reflect-metadata';
import * as fs from 'fs';
import * as path from 'path';
/**
* Configuration Module Options
*/
export interface ConfigModuleOptions {
/**
* Path to .env file (relative to project root)
*/
envFilePath?: string;
/**
* Whether to ignore .env file if it doesn't exist
*/
ignoreEnvFile?: boolean;
/**
* Whether to validate environment variables
*/
validate?: (config: Record<string, any>) => boolean;
/**
* Default values for environment variables
*/
defaults?: Record<string, string>;
}
/**
* Parse .env f
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key