{"id":20521602,"url":"https://github.com/hackmdio/config","last_synced_at":"2025-10-13T21:05:10.011Z","repository":{"id":48018974,"uuid":"181458452","full_name":"hackmdio/config","owner":"hackmdio","description":"A configuration management tool for HackMD","archived":false,"fork":false,"pushed_at":"2021-08-10T23:33:44.000Z","size":19,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-10-06T12:40:41.614Z","etag":null,"topics":["configuration-management","hackmd","nodejs","wip-do-not-use"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/hackmdio.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":"2019-04-15T09:50:02.000Z","updated_at":"2021-01-26T21:15:52.000Z","dependencies_parsed_at":"2022-08-12T16:50:25.478Z","dependency_job_id":null,"html_url":"https://github.com/hackmdio/config","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hackmdio/config","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackmdio%2Fconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackmdio%2Fconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackmdio%2Fconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackmdio%2Fconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackmdio","download_url":"https://codeload.github.com/hackmdio/config/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackmdio%2Fconfig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017015,"owners_count":26085949,"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-13T02:00:06.723Z","response_time":61,"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":["configuration-management","hackmd","nodejs","wip-do-not-use"],"created_at":"2024-11-15T22:30:06.990Z","updated_at":"2025-10-13T21:05:09.978Z","avatar_url":"https://github.com/hackmdio.png","language":"TypeScript","readme":"# @hackmd/config [![Build Status](https://travis-ci.org/hackmdio/config.svg?branch=master)](https://travis-ci.org/hackmdio/config)\n\nThis project is a configuration management tool for HackMD.\n\nIt inspired by [node-config](https://github.com/lorenwest/node-config).\n\n## Introduction\n\n@hackmd/config is a tool to manage mass configuration source, \nsuch as config file, environment, or docker secret.\n\nWe use config-provider to load difference config source. \nThe config-provider is a plugin for @hackmd/config.\n\n## How to use?\n\n1. You must setup which config type and config loaded order in your `package.json`\n\n```json\n\n{\n  \"name\": \"example-project\",\n  \"dependencies\": {\n    \"@hackmd/config\": \"0.0.1-alpha.1\"\n  },\n  \"config\": {\n    \"type\": \"./config/type.js\",\n    \"reader\": [\n      \"file:./config/default.js\",\n      \"env:APP\"\n    ]\n  }\n}\n\n```  \n\n2. Define your config type\n\n```js\nmodule.exports = {\n    host: String,\n    port: Number,\n    db: {\n        host: String,\n        port: String,\n        user: String,\n        pass: String,\n    },\n    allowHost: Array\n}\n```\n\n3. initialize `@hackmd/config` before your program\n\n```js\nconst config = require('@hackmd/config')\n\nawait config.buildAsync()\n\nmain();\n\n```\n\n4. in your program, you can use `require('@hackmd/config').getConfig()` to get your config object\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackmdio%2Fconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackmdio%2Fconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackmdio%2Fconfig/lists"}