{"id":13659846,"url":"https://github.com/litejs/dom","last_synced_at":"2026-04-03T00:48:00.133Z","repository":{"id":15245179,"uuid":"17974106","full_name":"litejs/dom","owner":"litejs","description":"Dependency-free DOM library for handling HTML files on server-side","archived":false,"fork":false,"pushed_at":"2026-02-19T22:48:29.000Z","size":457,"stargazers_count":26,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-02-20T01:06:15.299Z","etag":null,"topics":["document","dom","domparser","html","litejs","xml","xmlhttprequest"],"latest_commit_sha":null,"homepage":"https://litejs.com/","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/litejs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"lauriro"}},"created_at":"2014-03-21T09:09:04.000Z","updated_at":"2026-02-19T22:48:33.000Z","dependencies_parsed_at":"2024-01-15T20:48:47.999Z","dependency_job_id":"4ca2657e-af72-4545-bcae-0e29dd7487df","html_url":"https://github.com/litejs/dom","commit_stats":{"total_commits":225,"total_committers":7,"mean_commits":"32.142857142857146","dds":0.06666666666666665,"last_synced_commit":"47b0cfec261086ed38d8859526d04ec3733448c0"},"previous_names":["litejs/dom-lite"],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/litejs/dom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litejs%2Fdom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litejs%2Fdom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litejs%2Fdom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litejs%2Fdom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litejs","download_url":"https://codeload.github.com/litejs/dom/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litejs%2Fdom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29648434,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T09:27:29.698Z","status":"ssl_error","status_checked_at":"2026-02-20T09:26:12.373Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["document","dom","domparser","html","litejs","xml","xmlhttprequest"],"created_at":"2024-08-02T05:01:12.927Z","updated_at":"2026-04-03T00:48:00.123Z","avatar_url":"https://github.com/litejs.png","language":"JavaScript","readme":"\n[1]: https://badgen.net/coveralls/c/github/litejs/dom\n[2]: https://coveralls.io/r/litejs/dom\n[3]: https://packagephobia.now.sh/badge?p=@litejs/dom\n[4]: https://packagephobia.now.sh/result?p=@litejs/dom\n[5]: https://badgen.net/badge/icon/Buy%20Me%20A%20Tea/orange?icon=kofi\u0026label\n[6]: https://www.buymeacoffee.com/lauriro\n\n\nLiteJS DOM \u0026ndash; [![Coverage][1]][2] [![Size][3]][4] [![Buy Me A Tea][5]][6]\n==========\n\nDependency-free DOM library for handling HTML, XML and CSS files on server-side.\n\n\n```javascript\n// const { document } = require(\"@litejs/dom\");\nimport { document, CSSStyleSheet, DOMParser, XMLSerializer } from \"@litejs/dom\";\nimport { XMLHttpRequest } from \"@litejs/dom/net.js\";\n\n// Build DOM manually\nconst el = document.createElement(\"h1\");\nel.id = 123;\nel.className = \"large\";\n\nconst fragment = document.createDocumentFragment();\nfragment.appendChild(document.createTextNode(\"hello\"));\nel.appendChild(fragment);\n\n// Replace the DOM tree with HTML\nel.innerHTML = \"\u003cb\u003ehello world\u003c/b\u003e\";\nconsole.log(el.toString());\n// \u003ch1 id=\"123\" class=\"large\"\u003e\u003cb\u003ehello world\u003c/b\u003e\u003c/h1\u003e\n\n// Minify HTML\nconsole.log(el.toString(true));\n// \u003ch1 id=123 class=large\u003e\u003cb\u003ehello world\u003c/b\u003e\u003c/h1\u003e\n\nel.querySelectorAll(\"b\");\n// [ \"\u003cb\u003ehello world\u003c/b\u003e\" ]\n\n// Use XMLHttpRequest in server side\nconst xhr = new XMLHttpRequest();\nxhr.open(\"GET\", \"https://litejs.com\");\nxhr.responseType = \"document\";\nxhr.onload = function() {\n\tconst doc = xhr.responseXML;\n\t// Work with DOM in familiar way\n\tconsole.log(doc.querySelector(\"title\").textContent);\n}\nxhr.send();\n\n// Minify CSS\nimport { CSS } from \"@litejs/dom/css.js\";\nconst sheet = new CSSStyleSheet()\nsheet.replaceSync(\".a { color: hsl(0 0% 100%) }\")\nconsole.log(CSS.minify(sheet, { color: true }))\n// .a{color:#fff}\n```\n\n## Contributing\n\nFollow [Coding Style Guide](https://github.com/litejs/litejs/wiki/Style-Guide),\nrun tests `npm install; npm test`.\n\n\n\u003e Copyright (c) 2014-2026 Lauri Rooden \u0026lt;lauri@rooden.ee\u0026gt;  \n[MIT License](https://litejs.com/MIT-LICENSE.txt) |\n[GitHub repo](https://github.com/litejs/dom) |\n[npm package](https://npmjs.org/package/@litejs/dom) |\n[Buy Me A Tea][6]\n\n\n","funding_links":["https://github.com/sponsors/lauriro","https://www.buymeacoffee.com/lauriro"],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitejs%2Fdom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flitejs%2Fdom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitejs%2Fdom/lists"}