{"id":13800364,"url":"https://github.com/heroku/stillir","last_synced_at":"2025-05-13T09:31:35.357Z","repository":{"id":57553492,"uuid":"10744646","full_name":"heroku/stillir","owner":"heroku","description":"Cache environment variables as Erlang app variables","archived":false,"fork":false,"pushed_at":"2019-01-02T18:18:27.000Z","size":31,"stargazers_count":51,"open_issues_count":0,"forks_count":13,"subscribers_count":113,"default_branch":"master","last_synced_at":"2025-04-22T21:18:05.595Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heroku.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-17T19:00:30.000Z","updated_at":"2024-11-20T16:38:27.000Z","dependencies_parsed_at":"2022-09-26T18:40:55.841Z","dependency_job_id":null,"html_url":"https://github.com/heroku/stillir","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heroku%2Fstillir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heroku%2Fstillir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heroku%2Fstillir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heroku%2Fstillir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heroku","download_url":"https://codeload.github.com/heroku/stillir/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253913121,"owners_count":21983261,"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","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":"2024-08-04T00:01:11.852Z","updated_at":"2025-05-13T09:31:33.406Z","avatar_url":"https://github.com/heroku.png","language":"Erlang","funding_links":[],"categories":["Configuration Management"],"sub_categories":[],"readme":"# Stillir\n\nA library to cache Environmental variables for your Erlang application, useful when you\npass configuration details to your application using the environment.\n\nReason: http://www.12factor.net/config\n\n[![Build Status](https://travis-ci.org/heroku/stillir.svg?branch=master)](https://travis-ci.org/heroku/stillir)\n\n## The name\n\nStillir is icelandic for \"the one who configures\", it can also be used as a verb:\n\n```\nHann stillir kaffikönnuna\n```\n\nTranslates to\n\n```\nHe configures the coffee machine.\n```\n\n## Tests\n\n``` erlang\n$ rebar compile ct\n```\n\n## Erlang API\n\n### Types\n\n``` erlang\n-type app_name() :: atom().\n-type app_key() :: atom().\n-type env_key() :: string().\n-type env_var_value() :: string().\n-type app_key_value() :: any().\n-type default_value() :: app_key_value().\n-type transform_fun() :: fun(((env_var_value())) -\u003e app_key_value()).\n-type default_fun() :: fun(() -\u003e default_value()).\n-type transform() :: integer|float|binary|atom|boolean|transform_fun().\n-type opt() :: {default, any()|default_fun()}|{transform, transform()}|required.\n-type opts() :: [opt()]|[].\n-type config_spec() :: {app_key(), env_key()}|\n                       {app_key(), env_key(), opts()}.\n-type config_specs() :: [config_spec()].\n```\n\n`boolean` transform converts the following strings to booleans\n\n`true`: `true`, `yes`, `1`\n`false`: `false`, `no`, `0`\n\nand throws an error otherwise\n\n### Functions\n\n``` erlang\n-spec set_config(app_name(), config_specs()|[]) -\u003e ok|no_return().\n-spec set_config(app_name(), app_key(), env_key()) -\u003e ok|no_return().\n-spec get_config(app_name(), app_key()) -\u003e app_key_value()|no_return().\n-spec get_config(app_name(), app_key(), default_value()) -\u003e app_key_value().\n-spec update_env(app_name(), file:filename_all(), config_specs()|[]) -\u003e ok|no_return().\n```\n\nThe `transform_fun/0` is only run if the input is a list.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheroku%2Fstillir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheroku%2Fstillir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheroku%2Fstillir/lists"}