# domdiff **Repository Path**: mirrors_developit/domdiff ## Basic Information - **Project Name**: domdiff - **Description**: Diffing the DOM without virtual DOM - **Primary Language**: Unknown - **License**: ISC - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-05-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # domdiff [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat)](https://github.com/WebReflection/donate) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/domdiff/badge.svg?branch=master)](https://coveralls.io/github/WebReflection/domdiff?branch=master) [![Build Status](https://travis-ci.org/WebReflection/domdiff.svg?branch=master)](https://travis-ci.org/WebReflection/domdiff) [![License: ISC](https://img.shields.io/badge/License-ISC-yellow.svg)](https://opensource.org/licenses/ISC) A vDOM-less implementation of the [snabbdom](https://github.com/snabbdom/snabbdom) diffing logic. ### Signature ```js futureNodes = domdiff( parentNode, // where changes happen currentNodes, // Array of current items/nodes futureNodes, // Array of future items/nodes (returned) getNode, // optional way to retrieve a node from an item beforeNode // optional item/node to use as insertBefore delimiter ); ``` ### How to import it: * via **CDN**, as global variable: `https://unpkg.com/domdiff` * via **ESM**, as external module: `https://unpkg.com/domdiff/esm/index.js` * via **CJS**: `const EventTarget = require('domdiff').default;` ( or `require('domdiff/cjs').default` ) * via bundlers/transpilers: `import domdiff from 'domdiff';` ( or `from 'domdiff/esm'` ) ### Example ```js var nodes = { a: document.createTextNode('a'), b: document.createTextNode('b'), c: document.createTextNode('c') }; var parentNode = document.createElement('p'); var childNodes = [nodes.a, nodes.c]; parentNode.append(...childNodes); parentNode.textContent; // "ac" childNodes = domdiff( parentNode, childNodes, [nodes.a, nodes.b, nodes.c] ); parentNode.textContent; // "abc" ``` ### Compatibility: Every. JavaScript. Engine.