{"id":22130930,"url":"https://github.com/kahwee/dom2json","last_synced_at":"2026-05-18T03:02:02.905Z","repository":{"id":57214834,"uuid":"49387575","full_name":"kahwee/dom2json","owner":"kahwee","description":"Converts XML to JSON","archived":false,"fork":false,"pushed_at":"2020-05-23T12:15:19.000Z","size":119,"stargazers_count":1,"open_issues_count":21,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T11:42:45.831Z","etag":null,"topics":["json","xml"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kahwee.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":"2016-01-10T22:02:39.000Z","updated_at":"2020-06-03T17:40:55.000Z","dependencies_parsed_at":"2022-09-07T09:01:06.252Z","dependency_job_id":null,"html_url":"https://github.com/kahwee/dom2json","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kahwee/dom2json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kahwee%2Fdom2json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kahwee%2Fdom2json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kahwee%2Fdom2json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kahwee%2Fdom2json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kahwee","download_url":"https://codeload.github.com/kahwee/dom2json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kahwee%2Fdom2json/sbom","scorecard":{"id":547452,"data":{"date":"2025-08-11","repo":{"name":"github.com/kahwee/dom2json","commit":"6957ec52a1e1b114d771014b282e3934f258bd1c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: ISC License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T09:54:13.975Z","repository_id":57214834,"created_at":"2025-08-20T09:54:13.975Z","updated_at":"2025-08-20T09:54:13.975Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33163413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"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":["json","xml"],"created_at":"2024-12-01T18:27:25.211Z","updated_at":"2026-05-18T03:02:02.872Z","avatar_url":"https://github.com/kahwee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dom2json\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/kahwee/dom2json.svg)](https://greenkeeper.io/)\n\nThis converts DOM documents into a special blend of JSON. It was intended to be used for XML and now made to be generic to accomodate HTML documents as well. Please take a look at usage examples to see if it suits your needs.\n\n[![Build Status](https://travis-ci.org/kahwee/dom2json.svg?branch=master)](https://travis-ci.org/kahwee/dom2json)\n[![Coverage Status](https://coveralls.io/repos/github/kahwee/dom2json/badge.svg?branch=master)](https://coveralls.io/github/kahwee/dom2json?branch=master)\n[![npm version](https://badge.fury.io/js/dom2json.svg)](https://badge.fury.io/js/dom2json)\n[![bitHound Overall Score](https://www.bithound.io/github/kahwee/dom2json/badges/score.svg)](https://www.bithound.io/github/kahwee/dom2json)\n\n## Support\n\n* Browser (tested on Firefox)\n* `xmldom`\n\n## What is sacrificed?\n\nIn order for easy access to element node children, elements are grouped together.\n\nFor example, the following XML:\n\n```xml\n\u003cDrinks\u003e\n  \u003cCoffee\u003eLatte\u003c/Coffee\u003e\n  \u003cTea\u003eChai\u003c/Tea\u003e\n  \u003cCoffee\u003eMocha\u003c/Coffee\u003e\n  \u003cCoffee\u003eEspresso\u003c/Coffee\u003e\n  \u003cCoffee\u003eFlat White\u003c/Coffee\u003e\n  \u003cTea\u003eMint\u003c/Tea\u003e\n\u003c/Drinks\u003e\n```\n\nGets converted to:\n\n```\n{\n  \"document\": {\n    \"Drinks\": {\n      \"Coffee\": [\n        { $value: \"Latte\" },\n        { $value: \"Mocha\" },\n        { $value: \"Espresso\" },\n        { $value: \"Flat White\" }\n      ],\n      \"Tea\": [\n        { $value: \"Chai\" },\n        { $value: \"Mint\" }\n      ]\n    }\n  }\n}\n```\n\nSo there are some information loss here. Please use with caution!\n\n## Usage example\n\n```js\n// Optional:\n// const DOMParser = require('xmldom').DOMParser\n\nconst dp = new DOMParser()\nlet xml = dp.parseFromString(`\u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?\u003e\n  \u003cHello one=\"1\" two=\"2\" three=\"3\"\u003e\u003cHi class=\"a\"\u003e\u003ch1\u003eHello World\u003c/h1\u003e\u003c/Hi\u003e\u003cHi class=\"a\"\u003eHello again\u003c/Hi\u003e\u003c/Hello\u003e`, 'text/xml')\nresult = dom2json(xml)\n```\n\nResults:\n\n```json\n{\n  \"document\":{\n    \"Hello\":{\n      \"Hi\":[\n        {\n          \"h1\":[\n            {\n              \"$attrs\": {\n              },\n              \"$value\": \"Hello World\"\n            }\n          ],\n          \"$attrs\":{\n            \"class\": \"a\"\n          },\n          \"$value\": \"Hello World\"\n        },\n        {\n          \"$attrs\":{\n            \"class\": \"a\"\n          },\n          \"$value\": \"Hello again\"\n        }\n      ],\n      \"$attrs\":{\n        \"one\":\"1\",\n        \"two\":\"2\",\n        \"three\":\"3\"\n      }\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkahwee%2Fdom2json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkahwee%2Fdom2json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkahwee%2Fdom2json/lists"}