{"id":18292135,"url":"https://github.com/emmetio/xml-diff","last_synced_at":"2026-03-09T00:34:11.813Z","repository":{"id":42962658,"uuid":"226557654","full_name":"emmetio/xml-diff","owner":"emmetio","description":"Diff and patch contents of XML documents","archived":false,"fork":false,"pushed_at":"2023-07-19T21:24:43.000Z","size":216,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-04T21:59:03.724Z","etag":null,"topics":["diff","patch","xml"],"latest_commit_sha":null,"homepage":"","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/emmetio.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,"governance":null}},"created_at":"2019-12-07T18:22:29.000Z","updated_at":"2024-11-22T10:40:01.000Z","dependencies_parsed_at":"2022-09-10T15:51:16.596Z","dependency_job_id":"89e97786-970b-49fb-b023-59fde39bfc10","html_url":"https://github.com/emmetio/xml-diff","commit_stats":{"total_commits":89,"total_committers":1,"mean_commits":89.0,"dds":0.0,"last_synced_commit":"879b429b6125e549e64da792ecabfaac6a294078"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/emmetio/xml-diff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmetio%2Fxml-diff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmetio%2Fxml-diff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmetio%2Fxml-diff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmetio%2Fxml-diff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmetio","download_url":"https://codeload.github.com/emmetio/xml-diff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmetio%2Fxml-diff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30278559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T20:45:49.896Z","status":"ssl_error","status_checked_at":"2026-03-08T20:45:49.525Z","response_time":56,"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":["diff","patch","xml"],"created_at":"2024-11-05T14:16:50.537Z","updated_at":"2026-03-09T00:34:11.793Z","avatar_url":"https://github.com/emmetio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Diff XML documents\n\nThe goal of this module is to calculate diff between *text content* of two XML or HTML documents, preserving its tag structure:\n\n```js\nimport diff from '@emmetio/xml-diff';\n\nconst from = `\u003cdoc\u003e\n    \u003cp\u003eLorem ipsum dolor sit amet \u003cem\u003econsectetur, adipisicing\u003c/em\u003e elit.\u003c/p\u003e\n\u003c/doc\u003e`;\nconst to = `\u003cdoc\u003e\n    \u003cp\u003eLorem ipsum dolor sit amet aspernatur, \u003cstrong\u003edoloribus\u003c/strong\u003e in libero.\u003c/p\u003e\n\u003c/doc\u003e`;\n\nconst result = diff(from, to);\nconsole.log(result);\n/*\n\u003cdoc\u003e\n    \u003cp\u003eLorem ipsum dolor sit amet \u003cdel\u003econsectetur, adipisicing elit\u003c/del\u003e\u003cins\u003easpernatur, \u003c/ins\u003e\u003cstrong\u003e\u003cins\u003edoloribus\u003c/ins\u003e\u003c/strong\u003e\u003cins\u003e in libero\u003c/ins\u003e.\u003c/p\u003e\n\u003c/doc\u003e\n*/\n```\n\n---\n\u003e Project development is sponsored by [Xcential Corporation](https://xcential.com)\n---\n\n## Features\n* **High performance**: uses [small and fast XML scanner](https://github.com/emmetio/html-matcher), written in pure JavaScript.\n* **Supports multiple dialects**: able to parse invalid HTML, even JSX and Angular templates.\n* **Works everywhere**: doesn’t use browser DOM or APIs, runs in any browser, Node.JS and WebWorkers.\n\n## Installation \u0026 usage\n\nInstall it as regular npm module:\n\n```\nnpm install @emmetio/xml-diff\n```\n\nThis module exposes main `diff(from, to)` function which accepts two text documents and returns patched `to` document with updates marked with `\u003cins\u003e` and `\u003cdel\u003e` tags.\n\n## How it works\n\n* Takes XML document and strips all markup data from it (tags, comments, CDATA etc.), leaving plain text content: `\u003cdiv\u003eHello \u003cb\u003eworld\u003c/b\u003e!\u003c/div\u003e` → `Hello world!`.\n* Collapses and reduces insignificant white space characters like new lines, tabs and so on into a single space to reduce noise when comparing formatted documents.\n* Performs diff with Google’s [Diff Match Patch](https://github.com/google/diff-match-patch) library.\n* Applies patches to second document’s (`to`) plain content.\n* Restores markup and whitespace data of original document\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmetio%2Fxml-diff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmetio%2Fxml-diff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmetio%2Fxml-diff/lists"}