dom-diff

Diffing for a DOM-like DOM.

Showing:

Popularity

Downloads/wk

3

GitHub Stars

5

Maintenance

Last Commit

4yrs ago

Contributors

1

Package

Dependencies

1

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

dom-diff

Creates diffs of DOM or a virtual DOM that looks like the real DOM.

Installation

npm install dom-diff --save

Usage

var diff = require("dom-diff/diff");
var apply = require("dom-diff/patch");

var a = document.createElement("div");
var b = document.createElement("div");

b.appendChild(document.createElement("span"));

var patches = diff(a, b);
apply(a, patches);

Modules

dom-diff/diff

diff(Element, Element) -> patches

Given two elements, diffs them and returns an object containing patches.

dom-diff/patch

patch(Element, patches)

Given an element and a set of patches, the patches will be applied to the element.

dom-diff/serialize

serialize(patches) -> serializedPatches

Given a patches object will serialize it into a plain object that can be sent across WebWorker boundaries. You can further serialize this object to JSON if you need to send it across the network.

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100