{"id":17491787,"url":"https://github.com/kjshserver/json_file_change","last_synced_at":"2026-05-07T11:34:15.364Z","repository":{"id":41844133,"uuid":"485140655","full_name":"KjshServer/json_file_change","owner":"KjshServer","description":"Module for deno, to set, get and delete content of json file","archived":false,"fork":false,"pushed_at":"2022-04-27T00:02:02.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-18T11:56:46.553Z","etag":null,"topics":["deno","json","typescript"],"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/KjshServer.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":"2022-04-24T21:07:32.000Z","updated_at":"2022-07-07T02:51:15.000Z","dependencies_parsed_at":"2022-07-13T12:31:08.283Z","dependency_job_id":null,"html_url":"https://github.com/KjshServer/json_file_change","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KjshServer%2Fjson_file_change","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KjshServer%2Fjson_file_change/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KjshServer%2Fjson_file_change/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KjshServer%2Fjson_file_change/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KjshServer","download_url":"https://codeload.github.com/KjshServer/json_file_change/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246068261,"owners_count":20718501,"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":["deno","json","typescript"],"created_at":"2024-10-19T08:04:59.701Z","updated_at":"2026-05-07T11:34:15.007Z","avatar_url":"https://github.com/KjshServer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json_file_change v1.0.0\nModule for deno, load, set, get and delete content of json file\n\n# Import\n```typescript\nimport { _c } from \"https://deno.land/x/json_file_change@v1.0.0/mod.ts\"\n```\n\n# Load\nIf the json file does not exist it creates it automatically\n```typescript\n_c.load(`${Deno.cwd()}/src/config/config.json`)\n```\n\n# Set\ninsert or update data in file json file\u003cbr\u003e\nMaximum sub keys object \u003cbr\u003e\nMaximum arrays and objects within an array 1\u003cbr\u003e\nIMPORTANT: do not manually edit the file json use set\n```typescript\n_c.set(\"keyString\", \"string\")\n_c.set(\"keyNumber\", 1)\n_c.set(\"keyBoolean\", true)\n_c.set(\"keyObject\", {\n\t\"subKeyString\": \"string\",\n\t\"subKeyNumber\": 1,\n\t\"subKeyBoolean\": true,\n\t\"subKeyArray\": [\n\t\t{\n\t\t\t\"subKeyString\": \"string\",\n\t\t\t\"subKeyNumber\": 1,\n\t\t\t\"subKeyBoolean\": false,\n\t\t\t\"subKeyObject\": {\n\t\t\t\t\"subKeyString\": \"string\",\n\t\t\t\t\"subKeyNumber\": 1,\n\t\t\t\t\"subKeyBoolean\": true,\n\t\t\t}\n\t\t}\n\t],\n\t\"subKeyObject\": {\n\t\t\"subKeyString\": \"string\",\n\t\t\"subKeyNumber\": 1,\n\t\t\"subKeyBoolean\": true,\n\t\t\"subKeyArray\": [\n\t\t\t{\n\t\t\t\t\"subKeyString\": \"string\",\n\t\t\t\t\"subKeyNumber\": 1,\n\t\t\t\t\"subKeyBoolean\": false,\n\t\t\t}\n\t\t],\n\t}\n})\n\n```\n# Return\n```json\n{\n\t\"keyString\": \"string\",\n\t\"keyNumber\": 1,\n\t\"keyBoolean\": true,\n\t\"keyObject\": {\n\t\t\"subKeyString\": \"string\",\n\t\t\"subKeyNumber\": 1,\n\t\t\"subKeyBoolean\": true,\n\t\t\"subKeyArray\": [\n\t\t\t{\n\t\t\t\t\"subKeyString\": \"string\",\n\t\t\t\t\"subKeyNumber\": 1,\n\t\t\t\t\"subKeyBoolean\": false,\n\t\t\t\t\"subKeyObject\": {\n\t\t\t\t\t\"subKeyString\": \"string\",\n\t\t\t\t\t\"subKeyNumber\": 1,\n\t\t\t\t\t\"subKeyBoolean\": true\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t\"subKeyObject\": {\n\t\t\t\"subKeyString\": \"string\",\n\t\t\t\"subKeyNumber\": 1,\n\t\t\t\"subKeyBoolean\": true,\n\t\t\t\"subKeyArray\": [\n\t\t\t\t{\n\t\t\t\t\t\"subKeyString\": \"string\",\n\t\t\t\t\t\"subKeyNumber\": 1,\n\t\t\t\t\t\"subKeyBoolean\": false\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t}\n}\n```\n\n# Get\nGet key if it exists and if it doesn't exist, optional you can return a temporary value\n```typescript\nconsole.log(_c.get(\"keyString\", \"Other value optional if not exist\")) // \"string\"\nconsole.log(_c.get(\"keyNumber\", \"Other value optional if not exist\")) // 1\nconsole.log(_c.get(\"keyBoolean\", \"Other value optional if not exist\")) // true\nconsole.log(_c.get(\"keyObject\", \"Other value optional if not exist\")) // object{}\nconsole.log(_c.get(\"keyObject.subKeyString\", \"Other value optional if not exist\")) // \"string\"\nconsole.log(_c.get(\"keyObject.subKeyNumber\", \"Other value optional if not exist\")) // 1\nconsole.log(_c.get(\"keyObject.subKeyBoolean\", \"Other value optional if not exist\")) // true\nconsole.log(_c.get(\"keyObject.subKeyArray\", \"Other value optional if not exist\")) // array[]\nconsole.log(_c.get(\"keyObject.subKeyArray[0].subKeyString\", \"Other value optional if not exist\")) // \"string\"\nconsole.log(_c.get(\"keyObject.subKeyArray[0].subKeyNumber\", \"Other value optional if not exist\")) // 1\nconsole.log(_c.get(\"keyObject.subKeyArray[0].subKeyBoolean\", \"Other value optional if not exist\")) // \"Other value optional if not exist\"\nconsole.log(_c.get(\"keyObject.subKeyArray[0].subKeyObject\", \"Other value optional if not exist\")) // object{}\nconsole.log(_c.get(\"keyObject.subKeyArray[0].subKeyObject.subKeyString\", \"Other value optional if not exist\")) // \"string\"\nconsole.log(_c.get(\"keyObject.subKeyArray[0].subKeyObject.subKeyNumber\", \"Other value optional if not exist\")) // 1\nconsole.log(_c.get(\"keyObject.subKeyArray[0].subKeyObject.subKeyBoolean\", \"Other value optional if not exist\")) // true\nconsole.log(_c.get(\"keyObject.subKeyObject\", \"Other value optional if not exist\")) // object{}\nconsole.log(_c.get(\"keyObject.subKeyObject.subKeyString\", \"Other value optional if not exist\")) // \"string\"\nconsole.log(_c.get(\"keyObject.subKeyObject.subKeyNumber\", \"Other value optional if not exist\")) // 1\nconsole.log(_c.get(\"keyObject.subKeyObject.subKeyBoolean\", \"Other value optional if not exist\")) // true\nconsole.log(_c.get(\"keyObject.subKeyObject.subKeyArray\", \"Other value optional if not exist\")) // array[]\nconsole.log(_c.get(\"keyObject.subKeyObject.subKeyArray[0].subKeyString\", \"Other value optional if not exist\")) // \"string\"\nconsole.log(_c.get(\"keyObject.subKeyObject.subKeyArray[0].subKeyNumber\", \"Other value optional if not exist\")) // 1\nconsole.log(_c.get(\"keyObject.subKeyObject.subKeyArray[0].subKeyBoolean\", \"Other value optional if not exist\")) // \"Other value optional if not exist\"\nconsole.log(_c.get(\"keyObject.subKeyArray[0]\", \"Other value optional if not exist\")) // Other value optional if not exist\n\nconsole.log(_c.get(\"keyObject.subKeyObject.subKeyArray[0].subKeyBoolean\")) // \"\" is false\nconsole.log(_c.get(\"keyString1\", \"Other value optional if not exist\")) // Other value optional if not exist\nconsole.log(_c.get(\"keyString1\", \"Other value optional if not exist\")) // \"\"\n```\n# Return\nif exist return = value\u003cbr\u003e\nif not exist or is false return = Other title optional if not exist\"\n\n# Delete\nDelete key if exist\n```typescript\n_c.delete(\"keyString\")\n_c.delete(\"keyNumber\")\n_c.delete(\"keyBoolean\")\n_c.delete(\"keyObject\")\n_c.delete(\"keyObject.subKeyString\")\n_c.delete(\"keyObject.subKeyNumber\")\n_c.delete(\"keyObject.subKeyBoolean\")\n_c.delete(\"keyObject.subKeyArray\")\n_c.delete(\"keyObject.subKeyArray[0].subKeyString\")\n_c.delete(\"keyObject.subKeyArray[0].subKeyNumber\")\n_c.delete(\"keyObject.subKeyArray[0].subKeyBoolean\")\n_c.delete(\"keyObject.subKeyArray[0].subKeyObject\")\n_c.delete(\"keyObject.subKeyArray[0].subKeyObject.subKeyString\")\n_c.delete(\"keyObject.subKeyArray[0].subKeyObject.subKeyNumber\")\n_c.delete(\"keyObject.subKeyArray[0].subKeyObject.subKeyBoolean\")\n_c.delete(\"keyObject.subKeyObject\")\n_c.delete(\"keyObject.subKeyObject.subKeyString\")\n_c.delete(\"keyObject.subKeyObject.subKeyNumber\")\n_c.delete(\"keyObject.subKeyObject.subKeyBoolean\")\n_c.delete(\"keyObject.subKeyObject.subKeyArray\")\n_c.delete(\"keyObject.subKeyObject.subKeyArray[0].subKeyString\")\n_c.delete(\"keyObject.subKeyObject.subKeyArray[0].subKeyNumber\")\n_c.delete(\"keyObject.subKeyObject.subKeyArray[0].subKeyBoolean\")\n_c.delete(\"keyObject.subKeyArray[0]\") // error would be null\n```\n# Return\nDelete key subKeys object subObjects array subArrays\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjshserver%2Fjson_file_change","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkjshserver%2Fjson_file_change","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkjshserver%2Fjson_file_change/lists"}