{"id":15492122,"url":"https://github.com/imjuni/divideconfig","last_synced_at":"2025-09-16T20:56:54.437Z","repository":{"id":57213149,"uuid":"58725483","full_name":"imjuni/divideconfig","owner":"imjuni","description":"Smart configuration loader by distribution configuration","archived":false,"fork":false,"pushed_at":"2017-01-05T06:45:51.000Z","size":71,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-19T10:27:01.994Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://imjuni.github.io/divideconfig","language":"JavaScript","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/imjuni.png","metadata":{"files":{"readme":"README.md","changelog":"history.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-05-13T09:47:12.000Z","updated_at":"2017-05-26T09:06:24.000Z","dependencies_parsed_at":"2022-08-24T21:01:33.325Z","dependency_job_id":null,"html_url":"https://github.com/imjuni/divideconfig","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Fdivideconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Fdivideconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Fdivideconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imjuni%2Fdivideconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imjuni","download_url":"https://codeload.github.com/imjuni/divideconfig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299850,"owners_count":20916193,"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-02T07:58:53.068Z","updated_at":"2025-09-16T20:56:49.411Z","avatar_url":"https://github.com/imjuni.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"DivideConfig\n============\n\n[![Build Status](https://travis-ci.org/imjuni/divideconfig.svg?branch=master)](https://travis-ci.org/imjuni/divideconfig) [![Coverage Status](https://coveralls.io/repos/imjuni/divideconfig/badge.svg?branch=master)](https://coveralls.io/r/imjuni/divideconfig?branch=master)\n\n# Installation\n* npm\n```\nnpm install divideconfig --save\n```\n\n# Introduction\nDivideConfig is smart loader for your application configuration. DivideConfig is load by mode \nconfiguration. Mode is to separate for distribution that are development, stage, production. \nSee below configuration architecture.\n\n# Configuration Tree Architecture\n```\nconfig/\n  config.json\n  development.config.json\n  stage.config.json\n  production.config.json\n  |\n  +- database/\n    |\n    +- development.database.config.json\n    +- stage.database.config.json\n    +- production.database.config.json\n    \n  +- oAuth2/\n    |\n    +- development.oauth2.config.json\n    +- stage.oauth2.config.json\n    +- production.oauth2.config.json\n```       \n   \n## config.json\n```\n{\n  \"mode\": \"development\",\n  \"default: \"development\"\n}\n```\n\n## Load complete after Json architecture\n```\n{\n  \"database\": {\n    ... your configuration\n  },\n  \"oAuth2\": {\n    ... your configuration\n  }\n}\n```\n\nDivideConfig is loading all configuration file in config directory, that is starts with\nmode prefix and xxxx.config.json file. If you set development mode, load all files that \nis start with \"development\". For example, \"development.database.config.json\" and \n\"development.oauth2.config.json\".\n\nAll loading task is to execute synchronous. So you try to load configuration before your\napplication execute.\n\n# Why DivideConfig?\n* Separate configuration, production and development, stage\n* Before load to execute strip-json-comments, so your write comment in configuration. It so convenient.\n* You can set default configuration. If you set development, first loading development configuration and\n overwrite configuration in preloaded configuration.\n* Support hjson, yaml, HOCON\n  * HOCON configuration is make share configuration file with Java, Scala project\n  * JSON: .json\n  * YAML: .yaml, .yml\n  * HJSON: .hjson\n  * HOCON: .conf, .hocon\n \n# Example\nSee configuration example,\n\n* config/development_default_comon\n* config/production_default_development\n* config/production_default_development_hjson\n* config/production_default_development_yaml\n* config/production_default_development_hocon\n\n```\nvar path = require('path');\nvar loader = require('../lib/Loader');\nvar configuration = loader.loading(path.join(__dirname, '../config/production_default_development'), 'config.json');\n\nconsole.log(configuration);\n```\n\n# Warning\n* Javascript hoconfig-js library cannot parse specific comment(start with //). So you can use only start with # comment. Remind, you use only start with # comment.\n \n# Contribution guide\n* DivideConfig follow Airbnb Javascript guide.\n  * Commit before, execute below command\n  * npm run lint\n\n# More Help?\nSee example in config directory and test/loader.js. I create example configuration and test case.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjuni%2Fdivideconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimjuni%2Fdivideconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimjuni%2Fdivideconfig/lists"}