# 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
[](https://github.com/WebReflection/donate) [](https://coveralls.io/github/WebReflection/domdiff?branch=master) [](https://travis-ci.org/WebReflection/domdiff) [](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.