UNPKG

agentsqripts

Version:

Comprehensive static code analysis toolkit for identifying technical debt, security vulnerabilities, performance issues, and code quality problems

47 lines (44 loc) 2.33 kB
/** * @file Environment configuration management for runtime behavior control * @description Single responsibility: Centralize environment variable access and configuration validation * * This configuration module provides centralized access to environment variables and * runtime configuration settings used across the AgentSqripts platform. It ensures * consistent environment detection, provides fallback values for missing variables, * and enables environment-specific behavior customization across all analysis tools. * * Design rationale: * - Centralized environment access prevents scattered process.env usage across codebase * - Explicit exports provide clear documentation of required environment variables * - Future expansion point for environment validation and default value provision * - Enables consistent environment-based feature toggling across all analyzers * - Supports both development and production deployment configuration management * * Usage patterns: * - Development: NODE_ENV unset or 'development' enables verbose logging and debugging * - Production: NODE_ENV='production' optimizes performance and reduces output verbosity * - Testing: NODE_ENV='test' enables test-specific behaviors and mock data usage * - CI/CD: Environment detection enables automated behavior adjustments */ // Environment Variables /** * Node.js environment indicator for runtime behavior customization * * Technical function: Provides environment context for conditional behavior * * Implementation rationale: * - Direct process.env access centralized for consistent behavior * - Undefined handling allows graceful degradation in various environments * - Used across analyzers for environment-specific optimizations and output formatting * - Enables different verbosity levels and performance tuning based on deployment context * * Common values and behaviors: * - undefined or 'development': Verbose output, debugging enabled, slower comprehensive analysis * - 'production': Optimized output, performance-focused, essential logging only * - 'test': Test-friendly behavior, predictable output, mock-compatible operations * - Custom values: Enable specialized deployment-specific behavior customization */ const NODE_ENV = process.env.NODE_ENV; module.exports = { NODE_ENV };