{"id":15862197,"url":"https://github.com/afeiship/next-dom2json","last_synced_at":"2026-05-05T22:33:42.150Z","repository":{"id":57122673,"uuid":"293184039","full_name":"afeiship/next-dom2json","owner":"afeiship","description":"Dom to json for next.","archived":false,"fork":false,"pushed_at":"2020-11-20T03:24:57.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T13:53:44.067Z","etag":null,"topics":["dom","json","next","walk"],"latest_commit_sha":null,"homepage":"","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/afeiship.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-06T01:46:59.000Z","updated_at":"2020-11-20T03:25:00.000Z","dependencies_parsed_at":"2022-08-24T14:59:31.311Z","dependency_job_id":null,"html_url":"https://github.com/afeiship/next-dom2json","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/afeiship/next-dom2json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-dom2json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-dom2json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-dom2json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-dom2json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afeiship","download_url":"https://codeload.github.com/afeiship/next-dom2json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Fnext-dom2json/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32671033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dom","json","next","walk"],"created_at":"2024-10-05T22:25:38.130Z","updated_at":"2026-05-05T22:33:42.134Z","avatar_url":"https://github.com/afeiship.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# next-dom2json\n\u003e Dom to json for next.\n\n[![version][version-image]][version-url]\n[![license][license-image]][license-url]\n[![size][size-image]][size-url]\n[![download][download-image]][download-url]\n\n## installation\n```bash\nnpm install -S @jswork/next-dom2json\n```\n\n## usage\n```js\nimport '@jswork/next-dom2json';\n\nconst domElement = `\n  \u003cdiv class=\"list_item odd\" data-value=\"v1\" itemscope=\"\" itemtype=\"http://schema.org/Movie\"\u003e\n    123\n    \u003cspan\u003eabc\u003c/span\u003e\n    \u003cstrong\u003edef\u003c/strong\u003e\n  \u003c/div\u003e\n`;\nconst dom = new JSDOM(domElement);\nconst el = dom.window.document.querySelector('.list_item');\nconst json = nx.dom2json(el);\n\n// results:\n/*\n{\n  nodeName: 'div',\n  nodeType: 1,\n  attributes: {\n    class: 'list_item odd',\n    'data-value': 'v1',\n    itemscope: '',\n    itemtype: 'http://schema.org/Movie'\n  },\n  childNodes: [\n    {\n      nodeName: '#text',\n      nodeType: 3,\n      nodeValue: '\\n        123\\n        ',\n      childNodes: []\n    },\n    {\n      nodeName: 'span',\n      nodeType: 1,\n      attributes: {},\n      childNodes: [\n        {\n          nodeName: '#text',\n          nodeType: 3,\n          nodeValue: 'abc',\n          childNodes: []\n        }\n      ]\n    },\n    {\n      nodeName: '#text',\n      nodeType: 3,\n      nodeValue: '\\n        ',\n      childNodes: []\n    },\n    {\n      nodeName: 'strong',\n      nodeType: 1,\n      attributes: {},\n      childNodes: [\n        {\n          nodeName: '#text',\n          nodeType: 3,\n          nodeValue: 'def',\n          childNodes: []\n        }\n      ]\n    },\n    {\n      nodeName: '#text',\n      nodeType: 3,\n      nodeValue: '\\n      ',\n      childNodes: []\n    }\n  ]\n}\n*/\n```\n\n## license\nCode released under [the MIT license](https://github.com/afeiship/next-dom2json/blob/master/LICENSE.txt).\n\n[version-image]: https://img.shields.io/npm/v/@jswork/next-dom2json\n[version-url]: https://npmjs.org/package/@jswork/next-dom2json\n\n[license-image]: https://img.shields.io/npm/l/@jswork/next-dom2json\n[license-url]: https://github.com/afeiship/next-dom2json/blob/master/LICENSE.txt\n\n[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-dom2json\n[size-url]: https://github.com/afeiship/next-dom2json/blob/master/dist/next-dom2json.min.js\n\n[download-image]: https://img.shields.io/npm/dm/@jswork/next-dom2json\n[download-url]: https://www.npmjs.com/package/@jswork/next-dom2json\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-dom2json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafeiship%2Fnext-dom2json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Fnext-dom2json/lists"}