0.0.9 • Published 1 year ago

alu-json-diff v0.0.9

Weekly downloads
-
License
-
Repository
gitlab
Last release
1 year ago

alu-json-diff

Use the command line to compare two folders with the same directory structure and output their differences

If used alone, you can compare two json objects and output the difference (added, removed, edited)

Installation

npm install -g alu-json-diff

Usage

Cli

alu-json-diff oldSourceDirPath newSourceDirPath -o ./dist

Simple usage:

import { diff } from "alu-json-diff";

const struct1 = {
  a: 1,
  b: [{ c1: [{ c3: { c5: [1, 2, { c6: 3 }] } }, { c4: 6 }] }, { c2: 2 }],
};
const struct2 = {
  a: 11,
  b: [{ c1: [{ c3: { c5: [1, 2, { c6: 4 }] } }, { c4: 6 }] }, { c2: 2 }],
};

let result = diff(struct1, struct2);
console.log(result);
//   {
//      edited: [
//        ['a', 1, 11],
//        ['b[0]/c1[0]/c3/c5[2]/c6', 3, 4]
//      ],
//      added: [],
//      removed: []
//    }
0.0.9

1 year ago

0.0.8

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago