{"id":16889577,"url":"https://github.com/benoitc/econfig","last_synced_at":"2025-03-17T06:31:44.821Z","repository":{"id":3137887,"uuid":"4166623","full_name":"benoitc/econfig","owner":"benoitc","description":"simple Erlang config handler using INI files","archived":false,"fork":false,"pushed_at":"2016-06-10T08:54:07.000Z","size":256,"stargazers_count":78,"open_issues_count":3,"forks_count":12,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-27T19:04:04.815Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/benoitc.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2012-04-28T10:41:11.000Z","updated_at":"2024-05-17T16:40:19.000Z","dependencies_parsed_at":"2022-08-28T11:51:20.853Z","dependency_job_id":null,"html_url":"https://github.com/benoitc/econfig","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Feconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Feconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Feconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitc%2Feconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benoitc","download_url":"https://codeload.github.com/benoitc/econfig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243285615,"owners_count":20266848,"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-10-13T16:57:46.939Z","updated_at":"2025-03-17T06:31:44.473Z","avatar_url":"https://github.com/benoitc.png","language":"Erlang","readme":"\n\n# econfig - simple Erlang config handler using INI files #\n\nCopyright (c) 2012-2016 Benoît Chesneau.\n\n__Version:__ 0.7.3\n\n# econfig\n\neconfig is a simple Erlang config handler to manage a config from INI\nfiles.\n\n[![Build Status](https://travis-ci.org/benoitc/econfig.png?branch=master)](https://travis-ci.org/benoitc/econfig)\n[![Hex pm](http://img.shields.io/hexpm/v/econfig.svg?style=flat)](https://hex.pm/packages/econfig)\n\neconfig can be use to read and update INI files. Values are cached in an\nETS table and you can manage multiple configuration profiles. A process\ncan also subscribe to config updates events.\n\nAutoreload of the config when an INI file is updated is supported, you can even\nmanage changes from a full config directory.\n\nSee the [NEWS](http://github.com/benoitc/econfig/blob/master/NEWS.md)\nfor last changes.\n\n#### Useful modules are:\n\n- [`econfig`](http://github.com/benoitc/econfig/blob/master/doc/econfig.md): main module. It contains all the API.\n\n## Examples\n\nQuick usage example:\n\n```\n1\u003e application:ensure_all_started(econfig).\nok\n2\u003e econfig:register_config(test, [\"test/fixtures/test.ini\", \"test/fixtures/test2.ini\"], [autoreload]).\nok\n3\u003e econfig:subscribe(test).\ntrue\n4\u003e econfig:get_value(test, \"section1\").\n[{\"key 3\",\"value 3\"},\n {\"key1\",\"value1\"},\n {\"key2\",\"value 2\"},\n {\"key4\",\"value 4\"},\n {\"key5\",\"value5\"}]\n5\u003e econfig:set_value(test, \"section1\", \"key6\", \"value6\").\nok\n6\u003e flush().\nShell got {config_updated,test,{set,{\"section1\",\"key6\"}}}\nok\n```\n\n## Advanced features\n\n### on_change hook\n\nSome application may want to handle changes without suscribing to change. This change allows a user to pass a change function when registering the configuation. This function will be called each time a change happen.\n\n### helpers functions\n\neconfig do not guess datatypes of values in configuration files, always storing them internally as strings. This means that if you need other datatypes, you should convert on your own. Some helpers are provided to do it:\n\n- `econfig:get_boolean/{3, 4}`: to convert to boolean\n- `econfig:get_integer/{3, 4}`: to convert to integer\n- `econfig:get_float/{3, 4}`: to convert to float\n- `econfig:get_list/{3, 4}`: to convert a list of string separated by `,` to a list.\n- `econfig:get_binary/{3, 4}`: to convert to a binary\n\nContribute\n----------\nFor issues, comments or feedback please [create an issue!] [1]\n\n[1]: http://github.com/benoitc/econfig/issues \"econfig issues\"\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitc%2Feconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenoitc%2Feconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitc%2Feconfig/lists"}