1.3.0 • Published 7 years ago

html-differences v1.3.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

HTML-Differences

NPM

npm GitHub stars npm Travis

Use XPath and xmlDOM to locate deleted or new HTML Node from string.

Usage

var differ = require("html-differences").differ;
var first = "<p>Helloworld</p>";
var second = "<p>Hello<em>world</em></p>";
var result = differ(first, second);
/**
* result = {
*	equal:[{
*           path:XPath,
*           content:content,
*           attributes:attributes},
*           ...],
*	deleted:[{
*             path:XPath,
*             content:content,
*             attributes:attributes
*            },
*             ...],
*	added:[{
*           path:XPath,
*           content:content,
*           attributes:attributes
*           },
*           ...],
* }
*   attributes:{name:attribute_name,value:attribute_value}
*   e.g.: attribute:{name:'class',value:'button'}
*/

Run Test

npm test

1.3.0

7 years ago

1.2.0

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago