json-diff-viewer
v0.0.6
Published
diff viewer for json
Downloads
94
Readme
json-diff-viewer
diff viewer for json
install
npm install json-diff-viewer --save
usage
jsonViewer({ left = {}, right = {} }, options)
- {left, right} 需要diff的2个json
- options
- indent int 缩进 default 2
- space int 空格大小 default 5px,
example
const jsonViewer = require('json-diff-viewer');
const x = [{
a: 1,
b: 2,
f: {
x: 1
}
}];
const y = [{
a: 1,
b: 2,
c: 3,
d: 4,
e: {
x: 1
}
}];
const elemDom = jsonViewer({
left: x,
right: y
});
test
npm test