{"id":21913249,"url":"https://github.com/kevinhermawan/markup2json","last_synced_at":"2026-02-13T06:01:47.491Z","repository":{"id":65405216,"uuid":"591752141","full_name":"kevinhermawan/markup2json","owner":"kevinhermawan","description":"A library for converting HTML and XML into JSON","archived":false,"fork":false,"pushed_at":"2023-10-03T14:57:36.000Z","size":393,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-09T00:37:17.019Z","etag":null,"topics":["html-parser","html-to-json","html2json","javascript","typescript","xml-parser","xml-to-json","xml2json"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/markup2json","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/kevinhermawan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-01-21T18:51:07.000Z","updated_at":"2024-10-14T07:44:39.000Z","dependencies_parsed_at":"2024-12-06T17:43:30.739Z","dependency_job_id":null,"html_url":"https://github.com/kevinhermawan/markup2json","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"6b99381e813e551c8e9eed245a582deaf9f840cc"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/kevinhermawan/markup2json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhermawan%2Fmarkup2json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhermawan%2Fmarkup2json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhermawan%2Fmarkup2json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhermawan%2Fmarkup2json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevinhermawan","download_url":"https://codeload.github.com/kevinhermawan/markup2json/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhermawan%2Fmarkup2json/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231097,"owners_count":25245687,"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-09-08T02:00:09.813Z","response_time":121,"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":["html-parser","html-to-json","html2json","javascript","typescript","xml-parser","xml-to-json","xml2json"],"created_at":"2024-11-28T18:15:22.007Z","updated_at":"2026-02-13T06:01:42.473Z","avatar_url":"https://github.com/kevinhermawan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# markup2json\n\n![Minified size](https://img.shields.io/bundlephobia/min/markup2json) ![Test coverage](https://img.shields.io/codecov/c/github/kevinhermawan/markup2json) ![Monthly download](https://img.shields.io/npm/dm/markup2json)\n\n`markup2json` is a JavaScript library that provides an easy way to convert HTML and XML into JSON format. It uses the [@xmldom/xmldom](https://github.com/xmldom/xmldom) package to parse the input HTML/XML string and convert it into a JSON object. The library is designed to be lightweight, easy to use and compatible with both Node.js and web browsers.\n\n## Features\n\n- Malformed input validation\n- Supports HTML and XML\n- Supports Deno via NPM\n\n## Installation\n\nTo install `markup2json`, run the following command:\n\n**NPM**\n\n```\nnpm install markup2json\n```\n\n**Yarn**\n\n```\nyarn add markup2json\n```\n\n**pnpm**\n\n```\npnpm add markup2json\n```\n\n## Usage\n\n```ts\nimport markup2json from \"markup2json\";\n// import markup2json from \"npm:markup2json\"; // (for Deno)\n\nconst html = \"\u003cdiv class='container'\u003e\u003cp\u003eHello, World!\u003c/p\u003e\u003c/div\u003e\";\nconst json = markup2json(html);\n\nconsole.log(json);\n```\n\n**Output**\n\n```json\n{\n  \"tag\": \"div\",\n  \"attributes\": {\n    \"class\": \"container\"\n  },\n  \"children\": [\n    {\n      \"tag\": \"p\",\n      \"children\": [\n        {\n          \"tag\": \"#text\",\n          \"text\": \"Hello, World!\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n## License\n\n[MIT License](/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinhermawan%2Fmarkup2json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinhermawan%2Fmarkup2json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinhermawan%2Fmarkup2json/lists"}