@slimio/json-diff
v0.1.1
Published
Stdout difference from two JS Objects in the TTY
Downloads
22
Readme
Json-diff
Differentiates JSON in you terminal with color.
Requirements
- Node.js v12 or higher
Getting Started
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
Usage example
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:
API
jsonDiff(original: object, diff: object, options?: Options): void
Stdout the difference between two JSON Object. Available options is described by the following TypeScript interface
interface Options {
color?: boolean;
}
Dependencies
|Name|Refactoring|Security Risk|Usage| |---|---|---|---| |kleur|Minor|Low|TTY color|
License
MIT