{"id":13602772,"url":"https://github.com/AckeeCZ/configuru","last_synced_at":"2025-04-11T09:30:59.920Z","repository":{"id":34589392,"uuid":"180585658","full_name":"AckeeCZ/configuru","owner":"AckeeCZ","description":"Multiple-environment configuration manager","archived":false,"fork":false,"pushed_at":"2024-08-13T09:14:20.000Z","size":139,"stargazers_count":11,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-05T23:06:32.424Z","etag":null,"topics":["backend","builder","config","configuration","dot-env","env","environment","hacktoberfest","loader","node","nodejs","parser","preferences","process-env","setup","variable"],"latest_commit_sha":null,"homepage":"","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/AckeeCZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-10T13:16:49.000Z","updated_at":"2024-10-29T13:22:57.000Z","dependencies_parsed_at":"2024-07-18T12:19:29.763Z","dependency_job_id":null,"html_url":"https://github.com/AckeeCZ/configuru","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fconfiguru","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fconfiguru/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fconfiguru/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AckeeCZ%2Fconfiguru/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AckeeCZ","download_url":"https://codeload.github.com/AckeeCZ/configuru/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223464933,"owners_count":17149659,"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":["backend","builder","config","configuration","dot-env","env","environment","hacktoberfest","loader","node","nodejs","parser","preferences","process-env","setup","variable"],"created_at":"2024-08-01T18:01:37.577Z","updated_at":"2025-04-11T09:30:59.912Z","avatar_url":"https://github.com/AckeeCZ.png","language":"TypeScript","funding_links":[],"categories":["backend"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![](logo.png)\n\n\u003ch1\u003eConfiguru\u003c/h1\u003e\n\nManage the configuration of your Nodejs application with multiple environments and custom preferences, utilizing Configuru in CI and development as well!\n\nImprove the DX when managing the configuration files, get inline help and more with the [VS Code extension](https://github.com/AckeeCZ/configuru-extension).\n\n\u003c/div\u003e\n\n## Features\n\nConfiguru is a library for configuration management. Merge default project configuration with your user config, you can link yo your project. Atop of that, override your configuration with system environment variables.\n\n- :relieved: Tailored for multi-developer comfort\n- :sparkles: Cast and transforms inputs to the correct type\n- :blue_heart: Typescript friendly\n- :muscle: Designed for multi-environment apps\n- :see_no_evil: Anonymized configuration for logger\n- 💬 JSONC support\n\n## Getting started\n\n1. Install\n\n```bash\nnpm install configuru\n```\n\n2. Create `.env.jsonc` in root of your project, add defaults or placeholders.\n\n```jsonc\n{\n  // HTTP server\n  \"SERVER_PORT\": 3000 // port the server will be listening on\n}\n```\n\n3. _(optional)_ As a developer (or environment), create a custom override file (e.g. `~/.env/my-project.jsonc`) and save the path in your `CFG_JSON_PATH`.\n\n4. Create a configuration module (e.g. `config.ts`)\n\n```typescript\nimport { createLoader, values } from 'configuru'\n\n// create loader that cascades overrides and creates a config storage\nconst loader = createLoader()\n\n// Pass configuration schema to `values` transformer to get configuration\nexport default values({\n  server: {\n    // use loader accessors, place them in custom structure\n    // loader parses correct type from store\n    port: loader.number('SERVER_PORT'),\n  },\n})\n```\n\n5. Use your configuration params throughout your app\n\n```typescript\nimport config from './config' // e.g. { server: { port: 3000 } }\n\nconsole.log(config.server.port) // 3000\n```\n\n## Docs\n\n- [Config storage precedence](./wiki/storage-precedence.md)\n- [Advanced usage](./wiki/advanced-usage.md)\n- [Best practices](./wiki/best-practices.md)\n\n## See also\n\n- [`config`](https://www.npmjs.com/package/config) - Simple JSON config loader using NODE_ENV\n- [`dotenv`](https://www.npmjs.com/package/dotenv) - Load your configuration file to process.ENV\n- [`cosmiconfig`](https://www.npmjs.com/package/cosmiconfig) - Traverse your filesystem to load find your lost configuration file\n- [`configstore`](https://www.npmjs.com/package/configstore) - KV storage for configuration\n- [`figgy-pudding`](https://www.npmjs.com/package/figgy-pudding) - Config object builder / storage\n\nKnow other popular projects that solve the same issue? Open a PR to help people find what they need!\n\n## License\n\nThis project is licensed under [MIT](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAckeeCZ%2Fconfiguru","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAckeeCZ%2Fconfiguru","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAckeeCZ%2Fconfiguru/lists"}