{"id":20513687,"url":"https://github.com/webreflection/udomdiff","last_synced_at":"2025-05-16T06:04:23.967Z","repository":{"id":57384944,"uuid":"243485471","full_name":"WebReflection/udomdiff","owner":"WebReflection","description":"An essential diffing algorithm for µhtml.","archived":false,"fork":false,"pushed_at":"2024-11-28T13:32:04.000Z","size":182,"stargazers_count":155,"open_issues_count":4,"forks_count":11,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-01T14:14:50.515Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://medium.com/@WebReflection/the-web-smallest-dom-diffing-library-5b69ac4d1f4d","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/WebReflection.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-27T09:52:31.000Z","updated_at":"2025-03-30T02:58:46.000Z","dependencies_parsed_at":"2024-06-18T15:36:55.178Z","dependency_job_id":"3b63b5d9-acff-4273-9dfd-1d0888709af7","html_url":"https://github.com/WebReflection/udomdiff","commit_stats":{"total_commits":59,"total_committers":1,"mean_commits":59.0,"dds":0.0,"last_synced_commit":"e58db3ad28b72ade55a14452a73331a0db4d0871"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fudomdiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fudomdiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fudomdiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebReflection%2Fudomdiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebReflection","download_url":"https://codeload.github.com/WebReflection/udomdiff/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247878018,"owners_count":21011158,"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","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":[],"created_at":"2024-11-15T21:12:40.178Z","updated_at":"2025-04-08T16:04:25.800Z","avatar_url":"https://github.com/WebReflection.png","language":"JavaScript","readme":"# \u003cem\u003eµ\u003c/em\u003edomdiff\n\n[![Build Status](https://travis-ci.com/WebReflection/udomdiff.svg?branch=master)](https://travis-ci.com/WebReflection/udomdiff) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/udomdiff/badge.svg?branch=master)](https://coveralls.io/github/WebReflection/udomdiff?branch=master)\n\n![a different tree](./udomdiff-head.jpg)\n\n\u003csup\u003e**Social Media Photo by [Christopher Rusev](https://unsplash.com/@ralics) on [Unsplash](https://unsplash.com/)**\u003c/sup\u003e\n\nAn essential diffing algorithm for [µhtml](https://github.com/WebReflection/uhtml#readme).\n\n\n### Signature\n\n```js\nfutureNodes = udomdiff(\n  parentNode,           // where changes happen\n  [...currentNodes],    // Array of current items/nodes\n  [...futureNodes],     // Array of future items/nodes (returned)\n  get(node, toDoWhat),  // a callback to retrieve the node\n  before                // the anchored node to insertBefore\n);\n```\n\n### What is `get` and how does it work?\n\nYou can find all info from [domdiff](https://github.com/WebReflection/domdiff#a-node-generic-info--node-callback-for-complex-data), as it's exactly the same concept:\n\n  * `get(node, 1)` to retrieve the node that's being appended\n  * `get(node, 0)` to get the node to use for an `insertBefore` operation\n  * `get(node, -0)` to get the node to use for an `insertAfter` operation\n  * `get(node, -1)` to retrieve the node that's being removed\n\nIf you don't care about any of those second arguments values, `const get = o =\u003e o;` is a valid get too.\n\n\n### How to import it:\n\n  * via **CDN**, as global variable: `https://unpkg.com/udomdiff`\n  * via **ESM**, as external module: `import udomdiff from 'https://unpkg.com/udomdiff/esm/index.js'`\n  * via **CJS**: `const udomdiff = require('udomdiff');` \u003csup\u003e\u003csub\u003e( or `require('udomdiff/cjs')` )\u003c/sub\u003e\u003c/sup\u003e\n  * via bundlers/transpilers: `import udomdiff from 'udomdiff';` \u003csup\u003e\u003csub\u003e( or `from 'udomdiff/esm'` )\u003c/sub\u003e\u003c/sup\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreflection%2Fudomdiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebreflection%2Fudomdiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebreflection%2Fudomdiff/lists"}