{"id":16280919,"url":"https://github.com/m-sureshraj/dom_tree","last_synced_at":"2026-03-10T11:03:42.044Z","repository":{"id":39577745,"uuid":"104648031","full_name":"m-sureshraj/dom_tree","owner":"m-sureshraj","description":"🌲 Convert JavaScript Object, Array, and JSON into an interactive HTML tree view","archived":false,"fork":false,"pushed_at":"2023-01-03T20:56:46.000Z","size":8521,"stargazers_count":11,"open_issues_count":27,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-03T11:49:23.798Z","etag":null,"topics":["javascript","tree-view"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m-sureshraj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-24T13:58:45.000Z","updated_at":"2024-07-06T16:41:42.000Z","dependencies_parsed_at":"2023-02-01T10:02:10.087Z","dependency_job_id":null,"html_url":"https://github.com/m-sureshraj/dom_tree","commit_stats":null,"previous_names":["m-sureshraj/dom-tree"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/m-sureshraj/dom_tree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-sureshraj%2Fdom_tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-sureshraj%2Fdom_tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-sureshraj%2Fdom_tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-sureshraj%2Fdom_tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m-sureshraj","download_url":"https://codeload.github.com/m-sureshraj/dom_tree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-sureshraj%2Fdom_tree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002348,"owners_count":26083357,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript","tree-view"],"created_at":"2024-10-10T19:03:44.259Z","updated_at":"2025-10-10T00:41:28.748Z","avatar_url":"https://github.com/m-sureshraj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dom_tree\n![Travis (.org)](https://img.shields.io/travis/m-sureshraj/dom_tree)\n\nA small JavaScript library (with ZERO dependencies) to convert object, array, and JSON into an interactive HTML tree view. The dom_tree is fully [configurable](#options) and supports theming and keyboard navigation.\n\n```javascript\n// Convert following data\nconst data = {\n    name: 'Mr. Foo',\n    gender: 'Male',\n    age: 99,\n    isMarried: true,\n    wife: null,\n    children: ['bar', 'baz'],\n    friends: undefined,\n    location: {\n        district: 'underground',\n        zipcode: -100,\n    },\n};\n\n// Into\n```\n\n![dom_tree in action](https://raw.githubusercontent.com/m-sureshraj/dom_tree/master/media/dom_tree.gif)\n\n### Live Demo\n[![Edit dom_tree playground](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/domtree-playground-m91hr?fontsize=14\u0026hidenavigation=1\u0026theme=dark)\n\n## Installation\nYou can add dom_tree to your project via npm\n\n```\n\u003e npm install --save @sureshraj/dom_tree\n```\n\u003e Unfortunately, the package name `dom_tree` is not available on NPM. So it's published as a user scoped package with public access.\n\nOr load it from [unpkg.com](https://unpkg.com/)\n\n```html\n\u003clink rel=\"stylesheet\" href=\"https://unpkg.com/@sureshraj/dom_tree/dist/css/dom_tree.min.css\" /\u003e\n\u003cscript src=\"https://unpkg.com/@sureshraj/dom_tree/dist/js/dom_tree.min.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n* When using module bundlers\n\n```javascript\n// index.js\nimport DomTree from '@sureshraj/dom_tree';\nimport '@sureshraj/dom_tree/dist/css/dom_tree.min.css';\n\n// DOM node to initialize the tree\nconst targetNode = document.querySelector('#app');\n\n// data is the only required option\nconst options = { data: {} };\n\nconst dt = new DomTree(options, targetNode);\ndt.init();\n```\n\n* With plain HTML\n\n```html\n\u003c!-- index.html --\u003e\n\u003chead\u003e\n    \u003clink rel=\"stylesheet\" href=\"https://unpkg.com/@sureshraj/dom_tree/dist/css/dom_tree.min.css\" /\u003e\n    \u003cscript src=\"https://unpkg.com/@sureshraj/dom_tree/dist/js/dom_tree.min.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\n\u003cbody\u003e\n    \u003cdiv id=\"app\"\u003e\u003c/div\u003e\n\n    \u003cscript\u003e\n      const targetNode = document.querySelector(\"#app\");\n      const options = { data: {} };\n\n      // Above script will add `DomTree` to the window scope\n      const dt = new DomTree(options, targetNode);\n      dt.init();\n    \u003c/script\u003e\n\u003c/body\u003e\n```\n\n## Options\n| Option | Type | Required? | Default | Description |\n| --- | --- | --- | --- | --- |\n| data | `object` \\| `array` \\| `JSON` | required | - | Data source to generate the tree |\n| theme | `string` | optional | rose | 🌈 Available themes are `rose`, `one-dark`, `chrome-light`, and `darcula`. |\n| format | `string` | optional | object | Available formats are `object` and `json`. Use `json` to wrap the keys with double quotes. |\n| fold | `boolean` | optional | `false` | By default, the tree is fully expanded. Enable this option to fold the root, sub-nodes on the tree. |\n| separators | `boolean` | optional | `true` | This option adds a comma separator after each property. |\n| keyboardNavigation | `boolean` | optional | `false` | This option enables/disables the keyboard navigation. |\n| removeHighlightOnBlur | `boolean` | optional | `false` | This option removes the highlighted section when the tree gets blurred. You must enable the keyboard navigation to see this option in action. |\n\n## Methods\n| Method | Params | Description |\n| --- | --- | --- |\n| init | - | This method initializes the tree. |\n\n## Todo\n* Expose a method to update the initialized tree. [Issue](https://github.com/m-sureshraj/dom_tree/issues/22)\n\n## license\nMIT © [Sureshraj](https://github.com/m-sureshraj)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-sureshraj%2Fdom_tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm-sureshraj%2Fdom_tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-sureshraj%2Fdom_tree/lists"}