{"id":32182061,"url":"https://github.com/macchiato-framework/macchiato-env","last_synced_at":"2025-10-21T22:58:58.469Z","repository":{"id":57713827,"uuid":"75307426","full_name":"macchiato-framework/macchiato-env","owner":"macchiato-framework","description":"a library for managing environment settings from different sources","archived":false,"fork":false,"pushed_at":"2018-04-17T16:03:09.000Z","size":13,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-10-21T22:58:30.128Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/macchiato-framework.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-01T15:46:26.000Z","updated_at":"2019-03-28T20:46:40.000Z","dependencies_parsed_at":"2022-08-25T10:30:54.972Z","dependency_job_id":null,"html_url":"https://github.com/macchiato-framework/macchiato-env","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/macchiato-framework/macchiato-env","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macchiato-framework%2Fmacchiato-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macchiato-framework%2Fmacchiato-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macchiato-framework%2Fmacchiato-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macchiato-framework%2Fmacchiato-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/macchiato-framework","download_url":"https://codeload.github.com/macchiato-framework/macchiato-env/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/macchiato-framework%2Fmacchiato-env/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280348062,"owners_count":26315368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-21T22:58:54.149Z","updated_at":"2025-10-21T22:58:58.463Z","avatar_url":"https://github.com/macchiato-framework.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Environment variable library for macchiato\n\nSee the [macchiato framework](https://github.com/macchiato-framework) for more details\n\n\n[![Clojars Project](https://img.shields.io/clojars/v/macchiato/env.svg)](https://clojars.org/macchiato/env)\n\n## Usage\n\nThe configuration is represented by a map. the map is constructed by aggregating variables from\nmultiple sources in the environment. The default sources include EDN configuration and shell variables.\n\n### EDN Based Configuration\n\nThe library will first look for a `config.edn` file on the resource path. This will be used as the\nbase configuration for the application. An external configuration file can be specified using the\n`conf` environment variable at runtime, e.g: `export CONF=\"prod-config.edn\"`.\n\nThe configuration placed in the configuration file should consist of a map such as the following:\n\n```clojure\n{:port 4000\n :host \"127.0.0.1\"}\n```\n\nThis configuration will be merged on top of the configuration found in the environment.\nThe library uses a deep merge strategy, so any nested structures will be merged intelligently.\n\n### Managing Environment Variables\n\nEnvironment variable names are converted into Clojure style keywords. These variables are parsed using the following strategy:\n\n* `PORT=3000` -\u003e `{:port 3000}`\n* `NREPL_PORT=7000` - `{:nrepl-port 7000}`\n* `DATABASE_URL=\"jdbc:h2:./guestbook_dev.db\"` -\u003e `{:database-url \"jdbc:h2:./guestbook_dev.db\"}`\n* `IO__HTTP_MAX_CONNECTIONS=\"{:value 10}\"` -\u003e `{:io {:http-max-connections {:value 10}}}`\n\nNote that the `_` is converted to `-`, while `__` is used to indicate nesting for shell variables. These\nconventions can be mixed as seen with `IO__HTTP_MAX_CONNECTIONS`.\n\nThe library will attempt to parse variables in the following order:\n\n* attempt to parse numeric value\n* attempt to parse boolean\n* variables that start with a letter are treated as strings\n* any other variables are parsed as EDN\n\n### Configuration Order\n\nThe environment configuration will be read as the default.\n\nNext, the library will look for the `conf` environment variable. When present, it will attempt to read configuration from the file pointed to by this variable.\n\nWhen the `conf` environment variable is not present, the library will look for a file called `config.edn` at the location where the app was run.\n\nWhen a configuration file is found, it will be deep merged on top of the configuration read from the envrionment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacchiato-framework%2Fmacchiato-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmacchiato-framework%2Fmacchiato-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmacchiato-framework%2Fmacchiato-env/lists"}