{"id":21703577,"url":"https://github.com/codemonument/deno_update_denoconfig","last_synced_at":"2026-05-09T15:43:40.752Z","repository":{"id":230421126,"uuid":"779328867","full_name":"codemonument/deno_update_denoconfig","owner":"codemonument","description":"A package to update deno.json or deno.jsonc config files easily, without loosing comments","archived":false,"fork":false,"pushed_at":"2024-03-31T21:06:48.000Z","size":917,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-25T15:41:25.389Z","etag":null,"topics":[],"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/codemonument.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2024-03-29T15:23:54.000Z","updated_at":"2024-03-29T15:39:17.000Z","dependencies_parsed_at":"2024-11-25T21:43:43.117Z","dependency_job_id":null,"html_url":"https://github.com/codemonument/deno_update_denoconfig","commit_stats":null,"previous_names":["codemonument/deno_update_denoconfig"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_update_denoconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_update_denoconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_update_denoconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemonument%2Fdeno_update_denoconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemonument","download_url":"https://codeload.github.com/codemonument/deno_update_denoconfig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244656403,"owners_count":20488638,"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-11-25T21:33:39.232Z","updated_at":"2026-05-09T15:43:35.727Z","avatar_url":"https://github.com/codemonument.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# update-denoconfig package: cli \u0026 exported function\n\nA package to update deno.json or deno.jsonc config files easily, without loosing comments.\n\n## Run in deno without installation\n\nNote: Please adjust the `--config` path to your actual deno.jsonc file path and the `--kv` key-value pairs to your desired changes.\n\n```bash\ndeno run --allow-read=.,deno.jsonc --allow-write=.,deno.jsonc --allow-net=jsr.io jsr:@codemonument/update-denoconfig@1.0.6 --config ./deno.jsonc --kv.version=1.0.0 --kv.tasks.echo=\\\"echo \\\\\\\"Hello World!\\\\\\\"\\\"\n```\n\n## Install \u0026 Use as CLI\n\nInstall\n\n```bash\ndeno install -g deno install -g --allow-read=.,deno.jsonc --allow-write=.,deno.jsonc --allow-net=jsr.io jsr:@codemonument/update-denoconfig@1.0.6\n```\n\nUpdate (with -f flag to force install)\n\n```bash\ndeno install -gf --allow-read=.,deno.jsonc --allow-write=.,deno.jsonc --allow-net=jsr.io jsr:@codemonument/update-denoconfig@1.0.6\n```\n\nRun the cli\n\n```bash\nupdate-denoconfig --config ./deno.jsonc --kv.version=1.0.0 --kv.tasks.echo=\\\"echo \\\\\\\"Hello World!\\\\\\\"\\\"\n```\n\nResult: Updates the input deno.jsonc (or deno.json) file with the provided key-value pairs and while keeping all comments. (also does deep updates, as seen for `tasks.echo`!)\n\n```jsonc\n{\n\t// This is a comment\n\t\"version\": \"1.0.0\",\n\t\"tasks\": {\n\t\t\"echo\": \"echo \\\"Hello World!\\\"\"\n\t}\n}\n```\n\n## Install \u0026 use in a build script\n\n```bash\ndeno add @codemonument/update-denoconfig\n```\n\n```typescript\nimport {updateConfig} from '@codemonument/update-denoconfig';\n\nconst updateObject = {\n\tversion: '1.0.0',\n\ttasks: {\n\t\techo: \"echo 'Hello World!'\",\n\t},\n};\n\n// Note: The path is relative to the current working directory\nawait updateConfig('./deno.jsonc', updateObject);\n```\n\n## Important notes\n\nThis cli currently only supports two levels of key nesting (e.g. `tasks.echo`) and no array access.  \nFor example - given this `publish` key:\n\n```\n \"publish\": {\n    \"include\": [\n      \"./main.ts\",\n      \"./deno.jsonc\",\n      \"./deno.lock\",\n      \"./README.md\",\n      \"./LICENSE\",\n      \"./src\"\n    ]\n  }\n```\n\nThis cli is able to overwrite the whole `publish.include` array via `--kv.publish.include=[...]`, but not add or remove individual elements of the array.\n\nI only need it currently to update the `version` property, and I don't want to write a whole new `jq` cli.\nIf you need more advanced editing functionality in the cli or in the exported `updateConfig()` function, please open an issue or PR at https://github.com/codemonument/deno_update_denoconfig/issues !\n\n## How to release a new version (for maintainers)\n\n1. Update the version in `deno.jsonc`\n2. Update the version in `README.md` for the installation instructions\n3. Update CHANGELOG.md with the new version and changes\n4. Commit\n5. Tag the commit with the new version\n6. Push the commit and tag =\u003e Github Actions will automatically publish the new version to jsr\n\n## TODO (bjesuiter)\n\n- [ ] - branch out \"asset loading from jsr\" into it's own package\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemonument%2Fdeno_update_denoconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemonument%2Fdeno_update_denoconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemonument%2Fdeno_update_denoconfig/lists"}