react-json-compare-viewer

1.0.1 • Public • Published

A SIMPLE REACT COMPONENT WHICH CAN COMPARE TWO JSON VISUALLY

it is easy for you to use this component to show the differece of two json

u can customize the styles by cover the css class

demo

USAGE

  1. install

yarn add react-json-compare-viewer"

  1. quote

import JsonFormat from 'react-json-compare-viewer'

  1. use

<div>{ JsonFormat( {a: 1}, {a: 2} ) }</div>

ATTENTION

if u r use webpack5, u may encounter an error which say process is not defined.

because webpack5 do not include polyfills for nodejs

u can try add the following code to webpack config after yarn add process

...
plugins: [
    ...
    new webpack.ProvidePlugin({
      process: 'process/browser',
    }),
    ...
]

/react-json-compare-viewer/

    Package Sidebar

    Install

    npm i react-json-compare-viewer

    Weekly Downloads

    0

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    85.3 kB

    Total Files

    3

    Last publish

    Collaborators

    • fribble