{"id":43710854,"url":"https://github.com/artemovskiy/configuar","last_synced_at":"2026-02-05T06:33:04.731Z","repository":{"id":110008072,"uuid":"495107414","full_name":"artemovskiy/configuar","owner":"artemovskiy","description":"TypeScript config parser\u0026validator\u0026docs generator","archived":false,"fork":false,"pushed_at":"2023-09-29T05:48:31.000Z","size":109,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T04:26:31.055Z","etag":null,"topics":["config","nodejs","typescript","valid"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artemovskiy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-05-22T15:58:43.000Z","updated_at":"2023-01-17T18:24:22.000Z","dependencies_parsed_at":"2023-12-19T01:01:31.662Z","dependency_job_id":"b3c2ff1e-7ea8-4f35-b092-7f59dfbe243e","html_url":"https://github.com/artemovskiy/configuar","commit_stats":{"total_commits":73,"total_committers":4,"mean_commits":18.25,"dds":0.5753424657534247,"last_synced_commit":"35288ecd7bdbd6a4702fcc6d69a9b4bfd1823d0a"},"previous_names":["xydens/configuar"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/artemovskiy/configuar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemovskiy%2Fconfiguar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemovskiy%2Fconfiguar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemovskiy%2Fconfiguar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemovskiy%2Fconfiguar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artemovskiy","download_url":"https://codeload.github.com/artemovskiy/configuar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemovskiy%2Fconfiguar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29114910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T05:31:32.482Z","status":"ssl_error","status_checked_at":"2026-02-05T05:31:29.075Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["config","nodejs","typescript","valid"],"created_at":"2026-02-05T06:33:04.661Z","updated_at":"2026-02-05T06:33:04.726Z","avatar_url":"https://github.com/artemovskiy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Type-safe configuration loader for TypeScript\n\nThis package helps you:\n* define you app config type using classes\u0026decorators\n* validate the config according to class property types\n* read config values from environment and other sources like .env files\n* automatically generate documentation about the app config\n\n## How to use\n1. Install\n`yarn add configuar`\n2. Define your application config\n```typescript\nimport { EnvVariable } from 'configuar';\n\nexport default class AppConfig {\n  @EnvVariable()\n  port: number;\n\n  @EnvVariable()\n  dbUrl: string;\n}\n```\n3. Define the environment using variables or `.env` file\n```\n// .env\nPORT=3001\nDB_URL=postgres://localhost:5234/postgres\n```\n4. Read the configuration\n```typescript\nconst config = ConfigLoader.getConfig\u003cAppConfig\u003e({ ctor: AppConfig });\n/* AppConfig {\n  port: 3001,\n  dbUrl: `postgres://localhost:5234/postgres`\n} */\n```\n\n`getConfig` throws a validation error, if there are missing variables or wrong value types.\n5. Create config schema to share it with your colleagues\n```shell\nnpx configuar get-schema ./dist/app-config.ts\n```\nYou will get:\n\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"PORT\": {\n      \"type\": \"number\"\n    },\n    \"DB_URL\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\"PORT\", \"DB_URL\"]\n}\n```\n\nPut the schema to README.md to explain your colleagues which env variables are required to run the application.\n\nThis was just a basic example. You can [define nested config objects, use optional params](docs/config-class.md) and [use it within a Nestjs\napplication](docs/nest.md).\n\n## Docs\n\n- [Writing config class](docs/config-class.md)\n- [Reference](docs/reference.md)\n- [Usage with Nestjs](docs/nest.md)\n\n## Further plans\n\n1. Advanced validation: check value formats like Urls, integers etc\n2. More decorator options\n3. Flexible config schema generator: add human readable config docs generator\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartemovskiy%2Fconfiguar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartemovskiy%2Fconfiguar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartemovskiy%2Fconfiguar/lists"}