https://github.com/amirfarzamnia/deep-compare-objects
This is a JavaScript module designed to deeply compare two JavaScript objects and identify their differences. It's lightweight, easy to use, and efficient for a wide range of use cases.
https://github.com/amirfarzamnia/deep-compare-objects
arrays calculations compare datatypes deep diff differences javascript objects
Last synced: about 2 months ago
JSON representation
This is a JavaScript module designed to deeply compare two JavaScript objects and identify their differences. It's lightweight, easy to use, and efficient for a wide range of use cases.
- Host: GitHub
- URL: https://github.com/amirfarzamnia/deep-compare-objects
- Owner: amirfarzamnia
- License: mit
- Created: 2024-06-22T06:51:03.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-10-21T10:54:39.000Z (7 months ago)
- Last Synced: 2025-03-17T05:38:45.289Z (3 months ago)
- Topics: arrays, calculations, compare, datatypes, deep, diff, differences, javascript, objects
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Deep Compare Objects
**Deep Compare Objects** is a JavaScript module designed to deeply compare two JavaScript objects and identify their differences. It's lightweight, easy to use, and efficient for a wide range of use cases.
## Features
- Deep comparison of nested objects and arrays.
- Detects added, removed, and changed properties.
- Simple and intuitive API.
- Lightweight and dependency-free.## Installation
You can install this module via npm:
```sh
npm install deep-compare-objects
```or via yarn:
```sh
yarn add deep-compare-objects
```## Usage
Here's a quick example to get you started:
```javascript
import deepCompareObjects from 'deep-compare-objects';const a = { a: [1, 2, 3], b: { c: 1, d: 1 }, e: 'e', f: 'f', g: {} };
const b = { a: [3, 2, 1], b: { c: 1, d: 2 }, e: 'e', f: 'F', g: {} };console.log(deepCompareObjects(a, b)); // { a: [ 3, <1 empty item>, 1 ], b: { d: 2 }, f: 'F' }
```## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.