• getEnv - Determine the debug status based on environment variables or URL query parameters.

    Function

    Export

    Returns

    • True if debug conditions are met, otherwise returns the provided defaultValue.

    Example

    // Usage in Node.js environment
    process.env.DEBUG = 'true';
    console.log(getEnv()); // Outputs: true

    Example

    // Usage in Browser environment with URL: http://example.com?dev=debug=true
    console.log(getEnv()); // Outputs: true

    Parameters

    • Optional options: {
          defaultValue: boolean;
          nodeEnvVar: string;
          urlQueryParam: string;
          urlQueryValue: string;
      } = {}

      Configuration options for determining debug status.

      • defaultValue: boolean

        The default boolean value to return if no debug conditions are met.

      • nodeEnvVar: string

        The Node.js environment variable to check.

      • urlQueryParam: string

        The URL query parameter to check in a browser environment.

      • urlQueryValue: string

        The expected value of the URL query parameter to enable debugging.

    Returns any

Generated using TypeDoc