# cmprx-value

> Compare objects by value

Latest version **1.0.3** (published 2022-01-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install cmprx-value
pnpm add cmprx-value
yarn add cmprx-value
bun add cmprx-value
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2022-01-13 |
| First published | 2022-01-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Cvalencia |
| Maintainers | camilolenza |
| Keywords | js |

## Links

- npm: https://www.npmjs.com/package/cmprx-value
- Repository: https://github.com/acvalencia/cmpx-value
- Homepage: https://github.com/acvalencia/cmpx-value#readme
- Issues: https://github.com/acvalencia/cmpx-value/issues
- npm.io page: https://npm.io/package/cmprx-value

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.3 (latest) — 2022-01-13
- 1.0.2 — 2022-01-13
- 1.0.1 — 2022-01-12
- 1.0.0 — 2022-01-12

## README

# cmprx-value - Compare objects by Value

This package perform a comparation between two objects and returns true if whole object is equal to another object or false otherwise.

## Install
```
npm i cmprx-value
```

## Use
You can use this package to compare two objects and it returns "true" if they are equal and "false" otherwise.

```
import compareValue from  "cmprx-value";

let obj1 = {x: 2, y: 4, a: {b: 5, c: 6, d: {ff: 2, gg: 3}}, z: 10, i: 1};
let obj2 = {x: 2, y: 4, a: {b: 5, c: 6, d: {ff: 2, gg: 3}}, z: 10, i: 1};

console.log(compareValue(obj1, obj2));                 // true
console.log(compareValue({x: 1, y: 4}, {x: 1, y: 4})); // true
console.log(compareValue(['a', 'b'], ['a', 'b']));     // true

console.log(compareValue([1, 2, 3, 4], [1, 2, 3, 5])); // false
console.log(compareValue({x: 1, y: 4, i: 1}, {x: 1, y: 4, i: 2})); // false
console.log(compareValue({x: 1, y: 4, i: 1}, {x: 1, y: 4, i: 2})); // false
```

## Test
```
npm run test
```

## Note
Change to "type": "module" en package.json

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