🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@slimio/json-diff

Package Overview
Dependencies
Maintainers
5
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slimio/json-diff

Stdout difference from two JS Objects in the TTY

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
9
50%
Maintainers
5
Weekly downloads
 
Created
Source

Json-diff

version Maintenance MIT

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:

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

Keywords

json

FAQs

Package last updated on 23 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts