Giter Site home page Giter Site logo

jsondiffpatch.rs's Introduction

jsondiffpatch.rs

Diff & patch json object.


Usage

USAGE:
    jsondiffpath-cli <SUBCOMMAND>

OPTIONS:
    -h, --help    Print help information

SUBCOMMANDS:
    diff     diff two json file
    help     Print this message or the help of the given subcommand(s)
    patch    patch a json object with a patch document

diff

diff two json file

USAGE:
    jsondiffpath-cli diff <LEFT_JSON> <RIGHT_JSON>

ARGS:
    <LEFT_JSON>
    <RIGHT_JSON>

OPTIONS:
    -h, --help    Print help information

e.g.

LEFT_JSON:

{
    "bar": [
        1, 2, 3
    ],
    "foo": 10
}

RIGHT_JSON:

{
    "bar": [
        2, 3, 4
    ],
    "foo": 11
}

diff:

diff_example.png

patch

USAGE:
    jsondiffpath-cli patch <ORIGINAL_JSON> <PATCH_JSON>

ARGS:
    <ORIGINAL_JSON>
    <PATCH_JSON>

OPTIONS:

<ORIGINAL_JSON> is the base file to apply to the patch

<PATCH_JSON> is the patch file to apply to the base json (followed by JSON-Patch RFC6902)

jsondiffpatch-cli patch [left.json] [right.json]

e.g.

ORIGINAL_JSON:

{
    "foo": "Hello World",
    "bar": "Unknown"
}

PATCH_JSON:

[
    { "op": "replace", "path": "/foo", "value": "new value" },
    { "op": "add", "path": "/baz", "value": "added value" },
    { "op": "remove", "path": "/bar" }
]

result:

{
  "baz": "added value",
  "foo": "new value"
}

jsondiffpatch.rs's People

Contributors

nero5023 avatar wangzhuo2015 avatar

Stargazers

Julio Merisio avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.