# json-compare

> Compare two json object for matching deep keys, also supports regular-expression.

Latest version **0.0.15** (published 2017-05-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install json-compare
pnpm add json-compare
yarn add json-compare
bun add json-compare
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.15 |
| Published | 2017-05-18 |
| First published | 2017-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dave Amit |
| Maintainers | daveamit |
| Keywords | boilerplate, npm, module, node, javascript |

## Links

- npm: https://www.npmjs.com/package/json-compare
- Repository: https://github.com/daveamit/json-match
- Issues: https://github.com/daveamit/json-match/issues
- npm.io page: https://npm.io/package/json-compare

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.0.15 (latest) — 2017-05-18
- 0.0.14 — 2017-05-18
- 0.0.12 — 2017-05-18
- 0.0.13 — 2017-05-18
- 0.0.11 — 2017-05-18
- 0.0.10 — 2017-05-18
- 0.0.8 — 2017-05-18
- 0.0.6 — 2017-05-18
- 0.0.5 — 2017-05-18
- 0.0.4 — 2017-05-18
- 0.0.3 — 2017-05-18
- 0.0.2 — 2017-05-18

## README

# json-match
[![Build Status](https://travis-ci.org/daveamit/json-match.svg?branch=master)](https://travis-ci.org/daveamit/json-match) [![Coverage Status](https://coveralls.io/repos/github/daveamit/json-match/badge.svg)](https://coveralls.io/github/daveamit/json-match) [![Dependency Status](https://gemnasium.com/badges/github.com/daveamit/json-match.svg)](https://gemnasium.com/github.com/daveamit/json-match) [![bitHound Overall Score](https://www.bithound.io/github/daveamit/json-match/badges/score.svg)](https://www.bithound.io/github/daveamit/json-match) [![bitHound Code](https://www.bithound.io/github/daveamit/json-match/badges/code.svg)](https://www.bithound.io/github/daveamit/json-match)

## `NOTE: Currently does not support arrays`

## About
### Compare two json object for matching deep keys, also supports regular-expression.

usage:
```
npm install json-compare
```

```javascript
import compare from 'json-compare' // es6
// OR
const compare = require('json-compare') // good old es5

const source = {
    name: "Dave Amit",
    hobby: {
        game: 'The Division'
    },
    country: 'India',
};

const test = {
    name: /[a-zA-Z ]+/,
    hobby: {
        game: /Division/,
    },
    country: 'india',
};

const result = compare(source, test);
   // Result will be something like:

   {
    regExMatch: 2, // Because it matched 2 regular expressions
    exactMatch: 0, 
    fuzzyMatch: 1, // Because India to india match
    matchCount: 3, // Total keys matched
    mismatchCount: 0,
    unmatchedCount: 0,
    match: true,
    isExactMatch: false, // Because of fuzzyMatch
  }
```

---
_Source: https://npm.io/package/json-compare · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
