{"id":16497273,"url":"https://github.com/joaopaulomoraes/json-object-keys","last_synced_at":"2025-03-16T18:32:12.875Z","repository":{"id":92509718,"uuid":"607827818","full_name":"joaopaulomoraes/json-object-keys","owner":"joaopaulomoraes","description":"Manage complex object keys in depth.","archived":false,"fork":false,"pushed_at":"2024-04-28T22:38:42.000Z","size":532,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-27T12:17:11.796Z","etag":null,"topics":["depth","json","nesting","parser","regex","stringify"],"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/joaopaulomoraes.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-28T18:59:09.000Z","updated_at":"2024-09-12T19:03:02.000Z","dependencies_parsed_at":"2024-10-27T11:07:12.057Z","dependency_job_id":"c404a2d1-217c-4610-9645-8f50791e1af8","html_url":"https://github.com/joaopaulomoraes/json-object-keys","commit_stats":{"total_commits":37,"total_committers":1,"mean_commits":37.0,"dds":0.0,"last_synced_commit":"224e77f149c8094dd891cf9b5989eb50606848df"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaopaulomoraes%2Fjson-object-keys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaopaulomoraes%2Fjson-object-keys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaopaulomoraes%2Fjson-object-keys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joaopaulomoraes%2Fjson-object-keys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joaopaulomoraes","download_url":"https://codeload.github.com/joaopaulomoraes/json-object-keys/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826783,"owners_count":20354220,"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":["depth","json","nesting","parser","regex","stringify"],"created_at":"2024-10-11T14:39:03.091Z","updated_at":"2025-03-16T18:32:09.204Z","avatar_url":"https://github.com/joaopaulomoraes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![json-object-keys](https://user-images.githubusercontent.com/16243531/222727947-360bc403-92b8-4dc2-8d1b-586215b49a2f.jpg)\n\n# json-object-keys | ⚠️ WIP ⚠️\n\nManage complex object keys in depth.\n\n## Table of contents\n\n- [json-object-keys | ⚠️ WIP ⚠️](#json-object-keys--️-wip-️)\n  - [Table of contents](#table-of-contents)\n  - [Install](#install)\n    - [Bun](#bun)\n    - [PNPM](#pnpm)\n    - [NPM](#npm)\n    - [Yarn](#yarn)\n  - [Remove](#remove)\n    - [Remove an unique key](#remove-an-unique-key)\n    - [Remove multiple keys](#remove-multiple-keys)\n  - [Replace](#replace)\n    - [Replace an unique key](#replace-an-unique-key)\n    - [Replace multiple keys](#replace-multiple-keys)\n  - [License](#license)\n\n## Install\n\n### Bun\n\n```sh\nbun add json-object-keys\n```\n\n### PNPM\n\n```sh\npnpm add json-object-keys\n```\n\n### NPM\n\n```sh\nnpm install json-object-keys\n```\n\n### Yarn\n\n```sh\nyarn add json-object-keys\n```\n\n## Remove\n\n### Remove an unique key\n\n```ts\nimport { remove } from 'json-object-keys'\n\nremove(\n  {\n    id: 'e059d01a-7082-4b63-9c70-997491cdcf7c',\n    name: 'John Doe',\n    category: '65bf5579-710d-4f56-9907-8c0bb1b2f0d2',\n    email: 'john@doe.com',\n    age: 29,\n    ...\n  },\n  'category'\n)\n```\n\nOutput\n\n```diff\n{\n  id: 'e059d01a-7082-4b63-9c70-997491cdcf7c',\n  name: 'John Doe',\n- category: '65bf5579-710d-4f56-9907-8c0bb1b2f0d2',\n  email: 'john@doe.com',\n  age: 29\n}\n```\n\n### Remove multiple keys\n\n```ts\nimport { remove } from 'json-object-keys'\n\nremove(\n  {\n    id: 'e059d01a-7082-4b63-9c70-997491cdcf7c',\n    name: 'John Doe',\n    category: '65bf5579-710d-4f56-9907-8c0bb1b2f0d2',\n    email: 'john@doe.com',\n    age: 29\n  },\n  ['category', 'email']\n)\n```\n\nOutput\n\n```diff\n{\n  id: 'e059d01a-7082-4b63-9c70-997491cdcf7c',\n  name: 'John Doe',\n- category: '65bf5579-710d-4f56-9907-8c0bb1b2f0d2',\n- email: 'john@doe.com',\n  age: 29\n}\n```\n\n## Replace\n\n### Replace an unique key\n\n```ts\nimport { replace } from 'json-object-keys'\n\nreplace({ id: 1, foo: 2, baz: 3 }, { foo: 'bar' })\n```\n\nOutput\n\n```diff\n{\n  id: 1,\n+ bar: 2,\n  baz: 3\n}\n```\n\n### Replace multiple keys\n\n```ts\nimport { replace } from 'json-object-keys'\n\nreplace(\n  {\n    uuid: '65bf5579-710d-4f56-9907-8c0bb1b2f0d2',\n    name: 'Grandchild 1',\n    children: [\n      {\n        uuid: 'e059d01a-7082-4b63-9c70-997491cdcf7c',\n        name: 'Great Grandchild 1'\n      },\n      {\n        uuid: 'c579a0b8-c2c7-44e2-a7d9-2edba8f7b472',\n        name: 'Great Grandchild 2'\n      }\n    ]\n  }, { uuid: 'id', children: 'node' })\n```\n\nOutput\n\n```diff\n{\n+ id: '65bf5579-710d-4f56-9907-8c0bb1b2f0d2',\n  name: 'Grandchild 1',\n+ node: [\n    {\n+     id: 'e059d01a-7082-4b63-9c70-997491cdcf7c',\n      name: 'Great Grandchild 1'\n    },\n    {\n+     id: 'c579a0b8-c2c7-44e2-a7d9-2edba8f7b472',\n      name: 'Great Grandchild 2'\n    }\n  ]\n}\n```\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaopaulomoraes%2Fjson-object-keys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoaopaulomoraes%2Fjson-object-keys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoaopaulomoraes%2Fjson-object-keys/lists"}