0.1.1 • Published 4 years ago

@slimio/json-diff v0.1.1

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

Json-diff

version Maintenance MIT

Differentiates JSON in you terminal with color.

Requirements

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:

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

NameRefactoringSecurity RiskUsage
kleurMinorLowTTY color

License

MIT