{"id":21322101,"url":"https://github.com/advantageous/konf","last_synced_at":"2025-10-11T07:04:01.419Z","repository":{"id":57744297,"uuid":"57171902","full_name":"advantageous/konf","owner":"advantageous","description":"Java configuration library that uses JSON, YAML, JSON lax or Javascript configuration files.","archived":false,"fork":false,"pushed_at":"2016-06-15T18:40:53.000Z","size":161,"stargazers_count":19,"open_issues_count":4,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-12T05:39:06.060Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://advantageous.github.io/konf","language":"Java","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/advantageous.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":"2016-04-27T00:48:16.000Z","updated_at":"2023-06-09T11:14:38.000Z","dependencies_parsed_at":"2022-08-30T11:32:26.913Z","dependency_job_id":null,"html_url":"https://github.com/advantageous/konf","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/advantageous/konf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fkonf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fkonf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fkonf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fkonf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/advantageous","download_url":"https://codeload.github.com/advantageous/konf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/advantageous%2Fkonf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006560,"owners_count":26084128,"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-11T02:00:06.511Z","response_time":55,"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":"2024-11-21T20:13:16.633Z","updated_at":"2025-10-11T07:04:01.392Z","avatar_url":"https://github.com/advantageous.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[Konf Website](http://advantageous.github.io/konf/)\n\n# Konf - Typed Java Config system \nJava configuration library similar in concept to TypeSafe config,\nbut uses full \n\n* YAML \n* JSON\n* JSON Lax\n* JavaScript (useful to create Config DSLs, and basic config logic)\n* Java Pojos (Pojos, Lists, Maps, basic types)\n* TypeSafe Config\n* Java properties\n\nYou can also mix and match TypeSafe Config.\n\n***Konf*** allows you to easily create your own \n[config DSLs](https://github.com/advantageous/konf/wiki/Config-Logic---creating-your-own-config-DSL) \nsomething that is not possible with ***TypeSafe Config***.\n\n\n## Using Konf on your project\n\nKonf is in the [public maven repo](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.advantageous.konf%22).\n\n### Using konf from maven\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.advantageous.konf\u003c/groupId\u003e\n    \u003cartifactId\u003ekonf\u003c/artifactId\u003e\n    \u003cversion\u003e1.3.0.RELEASE\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Using konf from gradle\n```java\ncompile 'io.advantageous.konf:konf:1.3.0.RELEASE'\n```\n\n### Using konf from scala sbt\n```java\nlibraryDependencies += \"io.advantageous.konf\" % \"konf\" % \"1.3.0.RELEASE\"\n```\n\n### Using konf from clojure leiningen\n```lisp\n[io.advantageous.konf/konf \"1.3.0.RELEASE\"]\n```\n\nHere is an example config for JavaScript. \n\nKonf expects the `config` variable to be set to a JavaScript object with \nproperties.\n\n#### JavaScript based configuration for Java\n```javascript\nvar config = {\n\n  myUri: uri(\"http://host:9000/path?foo=bar\"),\n\n  someKey: {\n    nestedKey: 234,\n    other: \"this text\"\n  }\n\n};\n```\n\nYou can use full JavaScript for configuration as long as you define a\nvariable called `config` that results in a JavaScript object which\nequates to a Java map. \n\n\n## Defining your own DSL\n\nYou can define you own config DSL for your environment. \nWe have a [full example that shows you how to create a custom config DSL](https://github.com/advantageous/konf/wiki/Config-Logic---creating-your-own-config-DSL)\nfor your internal projects. The example uses Mesosphere and Docker PORT \nlook ups and it is from a real project. \n\n#### Defining your own config DSL\n```javascript\nvar config = {\n\n  platform: {\n\n    statsd: \"udp://\" + getDockerHost() + \":8125\",\n\n    servicePort: mesosPortAt(0, 8080),\n    adminPort: mesosPortAt(1, 9090),\n    ...\n```\n\nSee the real world for [example that uses Konf to find ports under\nMesosphere](https://github.com/advantageous/konf/wiki/Config-Logic---creating-your-own-config-DSL) \n(running in stating or prod) or under Docker (running on \na local developers box). \n\n## Overview\n\n* implemented in plain Java SDK almost no dependencies (sl4j, and reflekt with no others)\n* supports files in : YAML, JSON, JSON LAX, JavaScript, Java properties or any tree of Map/List basic types and POJOs\n* allows you to easily create your own config DSL\n* merges multiple configs across all formats\n* can load from configs, from classpath, http, file or just an Java Object tree\n* great support for \"nesting\" (treat any subtree of the config the same as the whole config)\n* users can override the config with Java system properties, java -Dmyapp.foo.bar=10 and sysProp \n* users can override the config with OS environment variables\n* supports configuring an app, with its framework and libraries, all from a single file such as application.yaml\n* parses duration and size settings, \"512k\" or \"10 seconds\"\n* converts types, so if you ask for a boolean and the value is the string \"yes\", or you ask for a float and the value is an int, it will figure it out.\n* API based on immutable Config instances, for thread safety and easy reasoning about config transformations\n* extensive test coverage\n\nThis library limits itself to config. \nIf you want to load config from another source, e.g., database or Redis or MongoDB, \nthen you would need to write some custom code. The library has nice support for merging \nconfigurations (Configs with fall-backs) so if you build a custom Config\n from a custom source it's easy to merge it in. Just implement Config and then use \n `config(config...)` to configure your config into a chain of other configs. \n This is described at length below see \"Loading config files with fallbacks\".\n\n##  License\n\nThe license is Apache 2.0.\n\n## Release Notes\n\nPlease see [Release Notes](https://github.com/advantageous/konf/releases), and\n[Release Notes In Progress](https://github.com/advantageous/konf/wiki/Release-Notes-Draft)\nfor the latest releases.\n\n## Build\n\nThe build uses gradle and the tests are written in Java; and, \nthe library itself is plain Java.\n\n## Using the Library\n\n```java\nimport io.advantageous.config.ConfigLoader;\n\nConfig conf = ConfigLoader.load(\"myconfig.js\", \"reference.js\");\nint bar1 = conf.getInt(\"foo.bar\");\nConfig foo = conf.getConfig(\"foo\");\nint bar2 = foo.getInt(\"bar\");\n```\n\n##  Longer Examples\n\nYou can see longer examples in [tests](https://github.com/advantageous/konf/blob/master/src/test/java/io/advantageous/config/JsLoadTest.java)\nalong with [sample config](https://github.com/advantageous/konf/blob/master/src/test/resources/test-config.js).\nYou can run these examples by `git cloning` this project and `running gradle test`.\n\nIn brief, as shown in the examples:\n\nYou create a Config instance provided by your application.\nYou use `ConfigLoader.load()` and you can define your own config system.\nYou could setup default `reference.yaml` or `reference.json` but you don't have to.\nYou could just load a single level of config. Config is as complex or as simple\nas you need. \n\nA `Config` can be created with the parser methods in `ConfigLoader.load`\n or built up from any POJO object tree or tree of Map/List/Pojos basic value.\nIt is very flexible. Examples are shown below and linked to below that use\n  JSON, YAML and allow you to define your own `DSL` like config.\nIt is very simple and easy to use. \n\n##  Immutability\n\nObjects are immutable, so methods on Config which transform the \nconfiguration return a new `Config`. \nThere is no complex tree of `Config` objects. Just `Config`. \nIt is pretty simple to use and understand.\n\n  \n## Java interface for Konf is Config.\n\nThe Java interface for Konf is Config.\nYou can get a sub Config from Config (`getConfig(path)`).\nThe `path` is always in dot notation (`this.that.foo.bar`).\nYou can also use:\n* `hasPath(path)`\n* `getInt(path)` \n* `getLong(path)`\n* `getDouble(path)`\n* `getBoolean(path)` can be true, false, \"yes\", \"no\", \"on\", \"off\", yes, no, off, on\n* `getString(path)`\n* `getStringList(path)` gets a list of strings\n* `getConfig(path)` gets a sub-config.\n* `getMap(path)` gets a map which is a sub-config.\n* `getConfigList(path)` gets a list of configs at the location specified.\n* `getIntList(path)` \n* `getLongList(path)`\n* `getDoubleList(path)`\n* `getBooleanList(path)`\n* `getDuration(path)` gets `java.time.Duration` useful for timeouts\n* `getDurationList(path)` gets duration list\n* `getUri(path)` gets `java.net.URI` useful for connecting to downstream services\n* `getUriList(path)` useful for connecting to downstream services\n\n\nThe `getMap` works with JavaScript objects (or Java maps see below for loading config from Java objects, YAML or JSON). \nThe `getStringList` and `getConfigList` works\nwith JavaScript array of string and a JavaScript array of JavaScript objects. \n\nNote you get an exception if the `path` requested is not found. \nUse `hasPath(path)` if you think the config path might be missing. \n\nHere is partial glimpse at the `Config` interface.\n\n#### Config interface\n```java\npublic interface Config {\n\n    /** Get string at location. */\n    String getString(String path);\n\n    /** Checks to see if config has the path specified. */\n    boolean hasPath(String path);\n\n    /** Get int at location. */\n    int getInt(String path);\n\n    /** Get float at location. */\n    float getFloat(String path);\n\n    /** Get double at location. */\n    double getDouble(String path);\n\n    /** Get long at location. */\n    long getLong(String path);\n\n    /** Get list of strings at location. */\n    List\u003cString\u003e getStringList(String path);\n\n    /** Get map at location. */\n    Map\u003cString, Object\u003e getMap(String path);\n\n    /** Get a sub-config at location. */\n    Config getConfig(String path);\n\n    /** Get list of sub-configs at location. */\n    List\u003cConfig\u003e getConfigList(String path);\n\n    /**  Get a single POJO out of config at path. */\n    \u003cT\u003e T get(String path, Class\u003cT\u003e type);\n\n    /**  Get a list of POJOs. */\n    \u003cT\u003e List\u003cT\u003e getList(String path, Class\u003cT\u003e componentType);\n    \n    /** Get duration. Good for timeouts */\n    Duration getDuration(String path);\n    \n    /** Get duration list. */\n    List\u003cDuration\u003e getDurationList(String path);\n    \n    /** Get int list. */\n    List\u003cInteger\u003e getIntegerList(String path);\n    ...\n}\n\n```\n\nThe `getX` methods work like you would expect. Given this config file.\n\n## JavaScript functions for config\n\n#### JavaScript functions that we support\n* `sysProp(propName)` to read a sysProp as in `fooSize : sysProp(\"my.foo.size\")`\n* `sysPropOrDefault(propName, defaultValue)` to read a sysProp or a default\n* `isWindowsOS()`, `isMacOS()`, `isUnix()`, `isLinux()`, `isSolaris()` \n* `env()` as in `fooSize : env('MY_FOO_SIZE')` or even `fooSize : sysPropOrDefault(\"my.foo.size\", env('MY_FOO_SIZE'))`\n* `uri()` which creates a `java.net.URI` as in `fooURI : uri (\"http://localhost:8080/\")` \n* `java.time.Duration` is imported as `duration` \n*  `java.lang.System` is imported as `system`  \n* `seconds(units)`, `minutes(units)`, `hours(units)`, `days(units)`, `millis(units)` and `milliseconds(units`) define a `Duration` which is useful for configuring timeouts and interval jobs\n* constants `yes`, `no`, `on`, `off` for boolean config\n* `load(resources...)` load a config\n* `configs(config...)` chain a group of configs\n* `bytes(units)`, `kilobytes(units)`, `megabytes(units)`, `gigabytes(units)` to read sizes\n\n#### Sample config for testing and showing how config works\n\n```javascript\nvar config = {\n\n  myUri: uri(\"http://host:9000/path?foo=bar\"),\n\n  someKey: {\n    nestedKey: 234,\n    other: \"this text\"\n  },\n\n  int1: 1,\n  float1: 1.0,\n  double1: 1.0,\n  long1: 1,\n  string1: \"rick\",\n  stringList: ['Foo', 'Bar'],\n  configInner: {\n    int2: 2,\n    float2: 2.0\n  },\n  uri: uri(\"http://localhost:8080/foo\"),\n  myClass: \"java.lang.Object\",\n  myURI: \"http://localhost:8080/foo\",\n  employee: {\"id\": 123, \"name\": \"Geoff\"},\n  employees: [\n    {id: 123, \"name\": \"Geoff\"},\n    {id: 456, \"name\": \"Rick\"},\n    {id: 789, 'name': \"Paul\"}\n  ]\n};\n\n```\n\n\nWe can do the following operations. \n\nFirst we load the config.\n\n#### Loading the config.\n\n```java\n\n    private Config config;\n\n    @Before\n    public void setUp() throws Exception {\n        config = ConfigLoader.load(\"test-config.js\");\n    }\n```\n\nNote that `ConfigLoader.load(resources...)` takes a variable length string array.\nBy default a resource String can contain a valid URI, which \ncan have the scheme `classpath`, `file`, or `http`. If you do not specify\na scheme than the path is assumed to be a classpath resource. \n\n#### Using different resources\n\n```java\n        config = ConfigLoader.load(\n                      \"/io/mycompany/foo-classpath.js\",\n                      \"classpath:test-config.js\",\n                      \"classpath://foo.js\",\n                      \"classpath:/bar.js\",\n                      \"file://opt/app/config.js\",\n                      \"file:///opt/app/config2.js\",\n                      \"file:/opt/app/config.js\",\n                      \"http://my.internal.server:9090/foo.js\"\n                      );\n\n```\n\nThen we show reading basic types with the `config` object using `getX`.\n\n#### Reading basic types from config\n\n```java\n    @Test\n    public void testSimple() throws Exception {\n\n        //getInt\n        assertEquals(1, config.getInt(\"int1\"));\n        \n        //getStringList\n        assertEquals(asList(\"Foo\", \"Bar\"), \n               config.getStringList(\"stringList\"));\n               \n        //getString       \n        assertEquals(\"rick\", config.getString(\"string1\"));\n        \n        //getDouble\n        assertEquals(1.0, config.getDouble(\"double1\"), 0.001);\n        \n        //getLong\n        assertEquals(1L, config.getLong(\"long1\"));\n        \n        //getFloat\n        assertEquals(1.0f, config.getFloat(\"float1\"), 0.001);\n        \n        //Basic JDK value types are supported like class.\n        assertEquals(Object.class, config.get(\"myClass\", Class.class));\n        \n        //Basic JDK value types are supported like URI.\n        assertEquals(URI.create(\"http://localhost:8080/foo\"), \n                config.get(\"myURI\", URI.class));\n                \n        assertEquals(URI.create(\"http://localhost:8080/foo\"), \n                config.get(\"uri\", URI.class));\n                \n    }\n\n```\n\nYou can work with nested properties as well.\n\n#### Reading a nested config from the config\n\n```java\n    @Test\n    public void testGetConfig() throws Exception {\n        //Read nested config.\n        final Config configInner = config.getConfig(\"configInner\");\n        assertEquals(2, configInner.getInt(\"int2\"));\n        assertEquals(2.0f, configInner.getFloat(\"float2\"), 0.001);\n    }\n\n    @Test\n    public void testGetMap() throws Exception {\n        //Read nested config as a Java map.\n        final Map\u003cString, Object\u003e map = config.getMap(\"configInner\");\n        assertEquals(2, (int) map.get(\"int2\"));\n        assertEquals(2.0f, (double) map.get(\"float2\"), 0.001);\n    }\n```\n\nYou can read deeply nested config items as well by specifying the \nproperty path using dot notation. \n    \n#### Reading nested properties with dot notation from config\n\n\n```java\n    @Test\n    public void testSimplePath() throws Exception {\n\n        assertTrue(config.hasPath(\"configInner.int2\"));\n        assertFalse(config.hasPath(\"configInner.foo.bar\"));\n        assertEquals(2, config.getInt(\"configInner.int2\"));\n        assertEquals(2.0f, config.getFloat(\"configInner.float2\"), 0.001);\n    }\n```\n\nYou can also read POJOs directly out of the config file.\n\n#### Reading a pojo directly out of the config file\n```java\n\n    @Test\n    public void testReadClass() throws Exception {\n        final Employee employee = config.get(\"employee\", Employee.class);\n        assertEquals(\"Geoff\", employee.name);\n        assertEquals(\"123\", employee.id);\n    }\n\n```\n\nYou can read a list of POJOs at once.\n\n#### Reading a pojo list directly out of the config file\n```java\n\n    @Test\n    public void testReadListOfClass() throws Exception {\n        final List\u003cEmployee\u003e employees = config.getList(\"employees\", Employee.class);\n        assertEquals(\"Geoff\", employees.get(0).name);\n        assertEquals(\"123\", employees.get(0).id);\n    }\n```\n\nYou can also read a list of config objects out of the config as well.\n\n#### Reading a config list directly out of the config file\n```java\n\n        final List\u003cConfig\u003e employees = config.getConfigList(\"employees\");\n        assertEquals(\"Geoff\", employees.get(0).getString(\"name\"));\n        assertEquals(\"123\", employees.get(0).getString(\"id\"));\n```\n\n## Using Config with YAML\n \n First include a YAML to object parser like [YAML Beans](https://github.com/EsotericSoftware/yamlbeans)\n or a library like this.\n \n#### Example YAML\n \n```yaml\n   name: Nathan Sweet\n     age: 28\n     address: 4011 16th Ave S\n     phone numbers:\n      - name: Home\n        number: 206-555-5138\n      - name: Work\n        number: 425-555-2306\n```\n \n#### Using Konf with YAML\n \n```java\n//Use YamlReader to load YAML file.\nYamlReader reader = new YamlReader(new FileReader(\"contact.yml\"));\n\n//Convert object read from YAML into Konf config\nConfig config = ConfigLoader.loadFromObject(reader.read());\n\n//Now you have strongly typed access to fields\nString address = config.getString(\"address\");\n```\n\nYou can also read Pojos from anywhere in the YAML file as well as \nsub configs. \n\n\n## You can also use Konf with JSON using Boon\n\nSee [Boon](https://github.com/advantageous/boon) JSON parser project,\nand [Boon in five minutes](https://github.com/boonproject/boon/wiki/Boon-JSON-in-five-minutes)\n\n#### Using Konf with JSON\n\n```java\nObjectMapper mapper =  JsonFactory.create();\n\n\n/* Convert object read from YAML into Konf config.\n  'src' can be File, InputStream, Reader, String. */\nConfig config = ConfigLoader.loadFromObject(mapper.fromJson(src));\n\n\n//Now you have strongly typed access to fields\nString address = config.getString(\"address\");\n\n```\n\nBoon supports LAX JSON (Json with comments, and you do not need to quote\nthe field).\n\n\n#### Working with java.time.Duration\n\n* `getDuration(path)` get a duration\n* `getDurationList(path)` get a duration list\n\nKonf supports \"10 seconds\" style config for duration as well as\nhaving built-in functions and support for ISO-8601. See documentation \nfor [duration config](https://github.com/advantageous/konf/wiki/Working-with-Durations)\nfor more details.\n\n##### Konf can reads list of numbers. \n\n* `getIntList` reads list of ints\n* `getLongList` reads list of longs\n* `getDoubleList` reads list of doubles\n* `getFloatList` reads list of floats\n\nSee documentation [list of number configuration](https://github.com/advantageous/konf/wiki/Working-with-lists-of-ints,-longs,-doubles,) \nfor more details.\n\n#### Konf can read memory sizes\n\n* `getMemorySize(path)` \n* `getMemorySizeList(path)`\n\n\n\nThis means we support config like:\n\n#### Sizes supported.\n```javascript\n\n  diskSpace : \" 10 gigabytes\",\n  diskVolumes : [\" 10 gigabytes\", \"10GB\", \"10 gigabytes\", 10]\n```\n\nWe support the following size Strings. \n\n#### Supported size strings\n```java\n\npublic enum MemorySizeUnit {\n\n    BYTES(1, \"B\", \"b\", \"byte\", \"bytes\"),\n    KILO_BYTES(1_000, \"kB\", \"kilobyte\", \"kilobytes\"),\n    MEGA_BYTES(1_000_000, \"MB\", \"megabyte\", \"megabytes\"),\n    GIGA_BYTES(1_000_000_000, \"GB\", \"gigabyte\", \"gigabytes\"),\n    TERA_BYTES(1_000_000_000, \"TB\", \"terabyte\", \"terabytes\"),\n    PETA_BYTES(1_000_000_000_000L, \"PB\", \"petabyte\", \"petabytes\"),\n    EXA_BYTES(1_000_000_000_000_000L, \"EB\", \"exabyte\", \"exabytes\"),\n    ZETTA_BYTES(1_000_000_000_000_000_000L, \"ZB\", \"zettabyte\", \"zettabytes\");\n    \n```\n\nYou can also specify the sizes with built-in functions if you don't\nwant to use strings.\n\n#### Using built-in functions to create sizes.\n```javascript\n  diskVolumes: [kilobytes(10), megabytes(10), bytes(10), gigabytes(10)]\n```\n\n## Loading config files with fallbacks\n\n#### \n```java\n\nimport static io.advantageous.config.ConfigLoader.*;\n...\n    private Config config;\n    ...\n        config = configs(config(\"test-config.js\"), config(\"reference.js\"));\n\n```\n\nYou can load config. The `config` method is an alias for `load(resources...)`.\nThe `configs(config...)` creates a series of configs where the configs\nare search from left to right. The first config that has the object (starting\nfrom the left or 0 index) will return the object. \n\nGive the following two configs (from the above example).\n\n#### test-config.js\n```javascript\nvar config = {\n  abc : \"abc\",\n```\n\n\n#### reference.js\n```javascript\nvar config = {\n  abc : \"abcFallback\",\n  def : \"def\"\n}\n```\n\nYou could run this test.\n\n#### Testing the reference.js is a fallback for test-config.js.\n\n```java\n\nimport static io.advantageous.config.ConfigLoader.*;\n...\n\n        config = configs(config(\"test-config.js\"), config(\"reference.js\"));\n\n        final String value = config.getString(\"abc\");\n        assertEquals(\"abc\", value);\n\n        final String value1 = config.getString(\"def\");\n        assertEquals(\"def\", value1);\n```\n\nYou can load your config anyway you like. The String `abc` is found\nwhen looking up the key `abc` because it is in the `test-config.js` which\ngets read before the value `abcFallback` which is in `reference.js`.\nYet the `def` key yields the `\"def\"` because it is defined in `reference.js`\nbut not `test-config.js`. You can implement the same style config reading and\nfallback as is in Type Safe Config but with your DSL.\n\n\n#### Using Konf with Typesafe Config\n\nThis allows you to combine TypeSafe `Config` and Konf `Config`.\nYou can have TypeSafe config be a fallback for Konf or the other way around.\n\n\nYou can load TypeSafe `Config` as a Konf `Config` instance as follows:\n\n#### Loading Typesafe config as a Konf Config object\n```java\n\n        Config config = TypeSafeConfig.typeSafeConfig();\n        final String abc = config.getString(\"abc\");\n        assertEquals(\"abc\", abc);\n```\n\nYou can also chain TypeSafe config as fallback or Konf `Config` as a fallback\nfor TypeSafe `Config` as follows:\n\n\n#### Konf as a fallback for TypeSafe config. \n\n```java\n\n\nimport static io.advantageous.config.ConfigLoader.config;\nimport static io.advantageous.config.ConfigLoader.configs;\nimport static io.advantageous.config.ConfigLoader.load;\n\n...\n\n    Config config;\n    ...\n        config = configs(TypeSafeConfig.typeSafeConfig(), config(\"test-config.js\"));\n```\n\n#### TypeSafe config as a fallback for Konf. \n\n```java\n\n\nimport static io.advantageous.config.ConfigLoader.config;\nimport static io.advantageous.config.ConfigLoader.configs;\nimport static io.advantageous.config.ConfigLoader.load;\n\n...\n\n    Config config;\n    ...\n        config = configs(config(\"test-config.js\"), TypeSafeConfig.typeSafeConfig());\n```\n\nYou can convert any TypeSafe `Config` into a Konf `Config` by using\n `TypeSafeConfig.fromTypeSafeConfig(typeSafeConfig)`.\n \nFind out more about TypeSafe config support at [Konf TypeSafe config](http://advantageous.github.io/konf-typesafe-config/).\n\n#### Thanks\n\nIf you like our configuration project, please try our \n[Reactive Java project](https://github.com/advantageous/reakt)\nor our [Actor based microservices lib](https://github.com/advantageous/qbit).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadvantageous%2Fkonf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadvantageous%2Fkonf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadvantageous%2Fkonf/lists"}