{"id":13906900,"url":"https://github.com/summerstyle/jsonTreeViewer","last_synced_at":"2025-07-18T04:33:19.300Z","repository":{"id":16614835,"uuid":"19369718","full_name":"summerstyle/jsonTreeViewer","owner":"summerstyle","description":"json formatter/viewer/pretty-printer (with jsonTree javascript-library)","archived":false,"fork":false,"pushed_at":"2020-03-04T09:05:49.000Z","size":60,"stargazers_count":313,"open_issues_count":11,"forks_count":98,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-11T18:54:57.627Z","etag":null,"topics":["json","json-tree","jsontree-library","library","lightweight","pure-javascript","vanilla-js","viewer"],"latest_commit_sha":null,"homepage":"http://summerstyle.github.io/jsonTreeViewer","language":"JavaScript","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/summerstyle.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}},"created_at":"2014-05-02T08:20:16.000Z","updated_at":"2024-10-05T15:09:40.000Z","dependencies_parsed_at":"2022-08-03T10:15:31.265Z","dependency_job_id":null,"html_url":"https://github.com/summerstyle/jsonTreeViewer","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/summerstyle%2FjsonTreeViewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/summerstyle%2FjsonTreeViewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/summerstyle%2FjsonTreeViewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/summerstyle%2FjsonTreeViewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/summerstyle","download_url":"https://codeload.github.com/summerstyle/jsonTreeViewer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226353508,"owners_count":17611716,"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-tree","jsontree-library","library","lightweight","pure-javascript","vanilla-js","viewer"],"created_at":"2024-08-06T23:01:44.421Z","updated_at":"2024-11-25T15:30:56.143Z","avatar_url":"https://github.com/summerstyle.png","language":"JavaScript","readme":"# jsonTreeViewer and jsonTree library\n\nThe library and the viewer released under the MIT license (LICENSE.txt).\n\n### jsonTreeViewer\n\nA simple json formatter/viewer based on [jsonTree library](#jsontree-library) and [app.js](https://github.com/summerstyle/app.js) framework.\n\nClone with submodules (including App.js library):\n\n```\ngit clone --recursive https://github.com/summerstyle/jsonTreeViewer.git\n```\n\nOnline: http://summerstyle.github.io/jsonTreeViewer\n\n1. Load json: click on \"load\" button and load a json-string to opened form\n2. Expand/collapse single nodes by click on label (recursively - by click with pressed `CTRL`/`META` key)\n3. Expand/collapse all tree nodes by click on \"expand all\" and \"collapse all\" buttons\n4. Mark/unmark node labels by click on label with pressed `ALT` key\n5. Show JSONPath of node by click on label with pressed `SHIFT` key\n\n\n### jsonTree library (JSON pretty-printer)\n\nA simple lightweight pure-javascript library for drawing tree of json-nodes from json-object.\nYou can get json-object from json-string by `JSON.parse(str)` method.\n\nDemo: http://summerstyle.github.io/jsonTreeViewer\n\nThe library includes only 2 files - [`libs/jsonTree/jsonTree.js`](https://github.com/summerstyle/jsonTreeViewer/blob/master/libs/jsonTree/jsonTree.js) (18 KB)\nand [`libs/jsonTree/jsonTree.css`](https://github.com/summerstyle/jsonTreeViewer/blob/master/libs/jsonTree/jsonTree.css) (2 KB).\n\n##### How to use:\n\nhtml:\n```html\n\u003clink href=\"libs/jsonTree/jsonTree.css\" rel=\"stylesheet\" /\u003e\n\u003cscript src=\"libs/jsonTree/jsonTree.js\"\u003e\u003c/script\u003e\n```\njavascript:\n```javascript\n// Get DOM-element for inserting json-tree\nvar wrapper = document.getElementById(\"wrapper\");\n\n// Get json-data by javascript-object\nvar data = {\n    \"firstName\": \"Jonh\",\n    \"lastName\": \"Smith\",\n    \"phones\": [\n        \"123-45-67\",\n        \"987-65-43\"\n    ]\n};\n\n// or from a string by JSON.parse(str) method\nvar dataStr = '{ \"firstName\": \"Jonh\", \"lastName\": \"Smith\", \"phones\": [\"123-45-67\", \"987-65-43\"]}';\ntry {\n    var data = JSON.parse(dataStr);\n} catch (e) {}\n\n// Create json-tree\nvar tree = jsonTree.create(data, wrapper);\n\n// Expand all (or selected) child nodes of root (optional)\ntree.expand(function(node) {\n   return node.childNodes.length \u003c 2 || node.label === 'phoneNumbers';\n});\n```\nYou can create many trees on one html-page.\n\n##### The available methods of each json tree:\n\n* `loadData(jsonObj)` - Fill new data to current json tree\n* `appendTo(domEl)` - Appends tree to DOM-element (or move it to new place)\n* `expand()` - Expands all tree nodes (objects or arrays) recursively\n* `expand(filterFunc)` - Expands only selected (by filter function) child nodes of root element\n* `collapse()` - Collapses all tree nodes (objects or arrays) recursively\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsummerstyle%2FjsonTreeViewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsummerstyle%2FjsonTreeViewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsummerstyle%2FjsonTreeViewer/lists"}