{"id":15010139,"url":"https://github.com/zookzook/hocon","last_synced_at":"2025-10-16T17:37:31.464Z","repository":{"id":57505129,"uuid":"224866018","full_name":"zookzook/hocon","owner":"zookzook","description":"Parse HOCON configuration files in Elixir following the HOCON specifications.","archived":false,"fork":false,"pushed_at":"2020-05-21T16:45:44.000Z","size":185,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T00:08:24.660Z","etag":null,"topics":["elixir","hocon"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zookzook.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":"2019-11-29T14:07:32.000Z","updated_at":"2024-05-22T23:19:33.000Z","dependencies_parsed_at":"2022-08-22T08:50:14.334Z","dependency_job_id":null,"html_url":"https://github.com/zookzook/hocon","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zookzook%2Fhocon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zookzook%2Fhocon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zookzook%2Fhocon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zookzook%2Fhocon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zookzook","download_url":"https://codeload.github.com/zookzook/hocon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248084250,"owners_count":21045123,"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":["elixir","hocon"],"created_at":"2024-09-24T19:30:45.126Z","updated_at":"2025-10-16T17:37:26.429Z","avatar_url":"https://github.com/zookzook.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hocon\nParse [HOCON](https://github.com/lightbend/config/blob/master/HOCON.md) configuration files in Elixir following the HOCON specifications.\n\n[![Build Status](https://travis-ci.org/zookzook/hocon.svg?branch=master)](https://travis-ci.org/zookzook/hocon)\n[![Coverage Status](https://coveralls.io/repos/github/zookzook/hocon/badge.svg?branch=master)](https://coveralls.io/github/zookzook/hocon?branch=master)\n[![codebeat badge](https://codebeat.co/badges/9b57f8e9-09b2-487d-8432-b00b1a13a47a)](https://codebeat.co/projects/github-com-zookzook-hocon-master)\n[![Hex.pm](https://img.shields.io/hexpm/v/hocon.svg)](https://hex.pm/packages/hocon)\n[![Hex.pm](https://img.shields.io/hexpm/dt/hocon.svg)](https://hex.pm/packages/hocon)\n[![Hex.pm](https://img.shields.io/hexpm/dw/hocon.svg)](https://hex.pm/packages/hocon)\n[![Hex.pm](https://img.shields.io/hexpm/dd/hocon.svg)](https://hex.pm/packages/hocon)\n\n## Basic usage\n\nAssume the file `my-configuration.conf` exists and has the following content:\n```hocon\n{\n  home : /path/to/home\n  timeout : 300\n  logger {\n    level = \"DEBUG\"\n  }\n}\n```\n\nThen you can read and parse the HOCON-Configuration file:\n\n```elixir\n\n    {:ok, body} = File.read(\"my-configuration.conf\")\n    result = Hocon.decode(body)\n\n    IO.puts inspect result\n\n    {:ok, %{\"home\" =\u003e \"path/to/home\", \"logger\" =\u003e %{\"level\" =\u003e \"DEBUG\"}, \"timeout\" =\u003e 300}}   \n\n```\n\nThe HOCON configuration is very powerfull and has a lot of nice features\n\n```hocon\n{\n  // you can use comments\n  \n  # you can concat arrays like this\n  dirs += ${PWD}\n  dirs += /working-folder\n  \n  # you can concat strings like this\n  path : ${PWD}\n  path : ${path}\"/working-folder\"\n  \n  # Here are several ways to define `a` to the same array value:\n  // one array\n  a : [ 1, 2, 3, 4 ]\n  // two arrays that are concatenated\n  a : [ 1, 2 ] [ 3, 4 ]\n  // with self-referential substitutions\n  a : [ 1, 2 ]\n  a : ${a} [ 3, 4 ]\n \n  # some nested objects:\n  foo { bar { baz : 42 } }\n  \n  # you can build values with substitutions\n  foo : { a : { c : 1 } }\n  foo : ${foo.a}\n  foo : { a : 2 }\n}\n```\n\nAfter parsing you get this map as result (where PWD=/Users/micha/projects/elixir/hocon):\n\n```elixir\n\n  %{\n    \"dirs\" =\u003e [\"/Users/micha/projects/elixir/hocon\", \"working-folder\"],\n    \"path\" =\u003e \"/Users/micha/projects/elixir/hocon/working-folder\"},\n    \"a\" =\u003e [1, 2, 3, 4], \n    \"foo\" =\u003e %{\"a\" =\u003e 2, \"bar\" =\u003e %{\"baz\" =\u003e 42}, \"c\" =\u003e 1} \n  }\n\n```\n\n## Spec Coverage\n\nhttps://github.com/lightbend/config/blob/master/HOCON.md\n\n- [x] parsing JSON\n- [x] comments\n- [x] omit root braces\n- [x] key-value separator\n- [x] commas are optional if newline is present\n- [x] whitespace\n- [x] duplicate keys and object merging\n- [x] unquoted strings\n- [x] multi-line strings\n- [x] value concatenation\n- [x] object concatenation\n- [x] array concatenation\n- [x] path expressions\n- [x] path as keys\n- [x] substitutions\n- [x] includes\n- [x] conversion of numerically-indexed objects to arrays\n- [x] allow URL for included files\n- [x] duration unit format\n- [x] period unit format\n- [x] size unit format","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzookzook%2Fhocon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzookzook%2Fhocon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzookzook%2Fhocon/lists"}