Differentiates JSON in you terminal with color.
- Node.js v12 or higher
This package is available in the Node Package Repository and can be easily installed with npm or yarn.
$ npm i @slimio/json-diff
# or
$ yarn add @slimio/json-diff
const jsonDiff = require("@slimio/json-diff");
const json1 = {
number: 10,
array: ["x", "y", "z"]
}
const json2 = {
number: 20,
array: ["x", "y", "w"]
}
jsonDiff(json1, json2);
It will produce the following stdout:
Stdout the difference between two JSON Object. Available options is described by the following TypeScript interface
interface Options {
color?: boolean;
}
Name | Refactoring | Security Risk | Usage |
---|---|---|---|
kleur | Minor | Low | TTY color |
MIT