{"id":38094452,"url":"https://github.com/dxcfg/dxcfg","last_synced_at":"2026-01-24T10:00:51.596Z","repository":{"id":46026758,"uuid":"426559356","full_name":"dxcfg/dxcfg","owner":"dxcfg","description":"Configuration as code for the masses","archived":true,"fork":false,"pushed_at":"2021-11-20T11:33:36.000Z","size":1678,"stargazers_count":27,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-20T22:04:00.286Z","etag":null,"topics":["configuration","deno","denoland","deployment-automation","devops","iaac","jkcfg","kubernetes","kubernetes-deployment","sre"],"latest_commit_sha":null,"homepage":"https://adnaan.badr.in/blog/2021/11/20/deno-for-infrastructure-as-code/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dxcfg.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":"2021-11-10T09:24:42.000Z","updated_at":"2025-05-08T15:00:17.000Z","dependencies_parsed_at":"2022-09-14T11:13:15.464Z","dependency_job_id":null,"html_url":"https://github.com/dxcfg/dxcfg","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/dxcfg/dxcfg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxcfg%2Fdxcfg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxcfg%2Fdxcfg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxcfg%2Fdxcfg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxcfg%2Fdxcfg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dxcfg","download_url":"https://codeload.github.com/dxcfg/dxcfg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxcfg%2Fdxcfg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28724374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T08:27:05.734Z","status":"ssl_error","status_checked_at":"2026-01-24T08:27:01.197Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["configuration","deno","denoland","deployment-automation","devops","iaac","jkcfg","kubernetes","kubernetes-deployment","sre"],"created_at":"2026-01-16T21:00:23.268Z","updated_at":"2026-01-24T10:00:51.571Z","avatar_url":"https://github.com/dxcfg.png","language":"TypeScript","funding_links":[],"categories":["Configuration Management"],"sub_categories":[],"readme":"# dxcfg\n\n[![dxcfg ci](https://github.com/dxcfg/dxcfg/workflows/ci/badge.svg)](https://github.com/dxcfg/dxcfg)\n[![codecov](https://codecov.io/gh/dxcfg/dxcfg/branch/main/graph/badge.svg?token=KEKZ52NXGP)](https://codecov.io/gh/dxcfg/dxcfg)\n[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/dxcfg/mod.ts)\n\n`dxcfg` allows you to use javascript/typescript to generate configuration in the\n[Deno](https://deno.land) sandbox.\n\n- For `developers` it can be used a familiar and expressive `frontend`.\n- For `operators` it can be used as a `backend` for enforcing schema validation,\n  security policies, resource usage policies and `hermeticity`:\n  [see hermeticity example](./examples/hermeticity).\n\nIts an `opinionated` port of [jkcfg](https://jkcfg.github.io/#/) API to deno and\nis a `work in progress`.\n\n## Example Usage\n\nLet's generate a multi resource yaml file using template literals. Here we use\n[template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)\nto generate a multi-resource yaml file.\n\n`index.js` uses the generated kubernetes types from the\n[dxcfg_kubernetes](https://github.com/dxcfg/dxcfg_kubernetes) module.\n\n```js\nimport { Format, param, write } from \"https://deno.land/x/dxcfg@v0.2.1/mod.ts\";\nimport { api } from \"https://deno.land/x/dxcfg_kubernetes@v0.1.0/mod.ts\";\n\nfunction resources(Values) {\n  return [\n    new api.apps.v1.createDeployment({\n      metadata: {\n        name: `${Values.name}-dep`,\n      },\n      spec: {\n        template: {\n          labels: { app: Values.app },\n          spec: {\n            containers: {\n              hello: {\n                image: `${Values.image.repository}:${Values.image.tag}`,\n              },\n            },\n          },\n        },\n      },\n    }),\n    new api.core.v1.createService({\n      metadata: {\n        name: `${Values.name}-svc`,\n        labels: { app: Values.app },\n      },\n      spec: {\n        selector: {\n          app: Values.app,\n        },\n      },\n    }),\n  ];\n}\n\nconst defaults = {\n  name: \"helloworld\",\n  app: \"hello\",\n  image: {\n    repository: \"weaveworks/helloworld\",\n    tag: \"v1\",\n  },\n};\n\nconst values = await param.object(\"values\", defaults);\nawait write(resources(values), \"chart.yaml\", { format: Format.MULTI_YAML });\n```\n\nRun with deno:\n\n```bash\ndeno run --unstable --allow-read --allow-write index.js -p values.name=demo -p values.image.tag=v2\n```\n\nwhich writes a `chart.yaml`:\n\n```\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: demo-dep\nspec:\n  template:\n    labels:\n      app: hello\n    spec:\n      containers:\n        hello:\n          image: 'weaveworks/helloworld:v2'\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: demo-svc\n  labels:\n    app: hello\nspec:\n  selector:\n    app: hello\n```\n\nSee more in [examples](./examples)\n\n## Principles\n\n- Keep the API surface small and obvious.\n- Free of opinions on how configuration should be managed.\n- Don’t reproduce features from other tools: helm, kustomize, cdktf etc. rather\n  provide integrations to call them.\n- Don’t write custom APIs for components: grafana, tekton etc. Use the official\n  SDK or expose a generated typescript api from openapi or CRD spec .\n\n## Roadmap\n\n- An example complex deployment pipeline on top of GKE/GCP\n- A typescript API for an efficient buildkit builder(written in Rust)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxcfg%2Fdxcfg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdxcfg%2Fdxcfg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxcfg%2Fdxcfg/lists"}