Skip to content

Stdout difference from two JS Objects in the TTY

License

Notifications You must be signed in to change notification settings

SlimIO/json-diff

Repository files navigation

Json-diff

version Maintenance MIT size dep known vulnerabilities Build Status

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

Name Refactoring Security Risk Usage
kleur Minor Low TTY color

License

MIT

About

Stdout difference from two JS Objects in the TTY

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •