An Elixir library for managing OS environment variables and application configuration with type casting, caching, and automatic documentation.
Skogsrå is an Elixir library that simplifies application configuration by providing a unified interface for OS environment variables and Elixir configuration files. It solves the problem of managing configuration across different environments with features like automatic type casting, runtime reloading, and environment-specific overrides, making configuration management more predictable and developer-friendly.
Elixir developers building applications that require robust configuration management across multiple environments (e.g., dev, test, prod), especially those using Elixir releases or needing to integrate with OS environment variables.
Developers choose Skogsrå over alternatives because it offers automatic type casting, caching with Erlang's :persistent_term for fast reads, and flexible environment overrides, reducing runtime errors and simplifying configuration code. Its unique selling point includes automatic documentation and template generation for OS environment variables.
Library to manage OS environment variables and application configuration options with ease
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Infers or explicitly casts configuration values to Elixir types like integers, atoms, or custom types, reducing runtime errors, as detailed in the automatic and explicit type casting sections with examples like casting strings to atoms.
Uses Erlang's :persistent_term for caching, enabling quick access to configuration values after initial load, which improves performance for frequent reads as mentioned in the caching section.
Allows overriding defaults and requirements per environment (e.g., dev, test, prod) using the env_overrides option, providing flexible configuration management as shown in the environment handling examples.
Generates documentation and specs for configuration variables based on @envdoc attributes, enhancing code clarity and maintainability, with options to disable it via config.
Caching with :persistent_term makes writes very slow, discouraging runtime configuration changes or reloading, as explicitly warned in the README's caching section.
Full features like YAML or JSON config providers require adding external libraries (yamerl or jason), increasing project complexity and dependency management.
Defining configuration modules with options like binding_order or custom types can be more complex and verbose than using Elixir's native config for simple use cases.