{"id":22062457,"url":"https://github.com/xucongli1989/json-structure-compare","last_synced_at":"2026-04-10T22:33:06.418Z","repository":{"id":57285317,"uuid":"134834253","full_name":"xucongli1989/json-structure-compare","owner":"xucongli1989","description":"This is a json structure compare tool,you can input two json data and run node script to get a comparative report via Beyond Compare.","archived":false,"fork":false,"pushed_at":"2018-05-30T02:57:39.000Z","size":1410,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T10:08:43.355Z","etag":null,"topics":["json","json-compare","json-structure-compare","node"],"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/xucongli1989.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":"2018-05-25T09:23:27.000Z","updated_at":"2018-05-30T02:48:31.000Z","dependencies_parsed_at":"2022-09-26T22:21:41.605Z","dependency_job_id":null,"html_url":"https://github.com/xucongli1989/json-structure-compare","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xucongli1989%2Fjson-structure-compare","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xucongli1989%2Fjson-structure-compare/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xucongli1989%2Fjson-structure-compare/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xucongli1989%2Fjson-structure-compare/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xucongli1989","download_url":"https://codeload.github.com/xucongli1989/json-structure-compare/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245143960,"owners_count":20568046,"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":["json","json-compare","json-structure-compare","node"],"created_at":"2024-11-30T18:20:08.111Z","updated_at":"2026-04-10T22:33:06.348Z","avatar_url":"https://github.com/xucongli1989.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Introduction\nThis is a json structure compare tool,you can input two json data and run node script to get a comparative report via Beyond Compare.\n\n## Start\n\n- Create your project,and it has `./dist/` directory\n\n- `npm install json-structure-compare --save-dev`\n\n- Create file `./test.js` and write your code like this\n\n\t\tlet moduleInfo = require('json-structure-compare');\n\t\tlet obj = new moduleInfo.Compare({\n\t\t    dataA: { \"a\": \"test\" },\n\t\t    dataB: { \"b\": \"test\" },\n\t\t    beyondComparePath: \"C:\\\\Program Files (x86)\\\\Beyond Compare 4\\\\BComp.exe\",\n\t\t    outputPath: \"./dist/\"\n\t\t});\n\t\tobj.run();\n\n- Run script `node test.js`\n\n- So,you will get your comparative result,see your console's log.\n\n## Config Options\n\n    /**\n\t * The default config.\n\t */\n\tinterface IDefaultConfig {\n\t    /**\n\t     * Beyond Compare soft path.\n\t     */\n\t    beyondComparePath: string\n\t    /**\n\t     * Your work space for output \n\t     */\n\t    outputPath: string\n\t    /**\n\t     * Json A to compare.\n\t     */\n\t    dataA: IAnyPropObject\n\t    /**\n\t     * Json B to compare.\n\t     */\n\t    dataB: IAnyPropObject\n\t}\n\nThe default value is:\n\n    let defaultConfig: IDefaultConfig = {\n\t    beyondComparePath: \"C:\\\\Program Files\\\\Beyond Compare 4\\\\BComp.exe\",\n\t    outputPath: path.resolve(\"./dist/\"),\n\t    dataA: data.a,\n\t    dataB: data.b\n\t}\n\n\n## Theory\n\n- Convert json object to path string array with keys,like `[\"A.B\",\"A.B.C\",\"A.B.C.D\",...]`\n\n- Compare the lines use Beyond Compare tool.\n\n- Notice:If one key is `Array` ,then compare the first item only.\n\n## Demo Result Preview\n\n![](https://raw.githubusercontent.com/xucongli1989/json-structure-compare/master/img.jpg)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxucongli1989%2Fjson-structure-compare","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxucongli1989%2Fjson-structure-compare","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxucongli1989%2Fjson-structure-compare/lists"}