# @sz-sw-le1/object-diff-properties

> Compare property names of two objects `a` and `b`.

Latest version **1.0.0** (published 2021-04-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sz-sw-le1/object-diff-properties
pnpm add @sz-sw-le1/object-diff-properties
yarn add @sz-sw-le1/object-diff-properties
bun add @sz-sw-le1/object-diff-properties
```

## 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.0 |
| Published | 2021-04-20 |
| First published | 2021-04-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | SZ-Software |
| Maintainers | sz-coder |

## Links

- npm: https://www.npmjs.com/package/@sz-sw-le1/object-diff-properties
- npm.io page: https://npm.io/package/@sz-sw-le1/object-diff-properties

## Dependencies (1)

- [@sz-sw-le0/object-get-properties](https://npm.io/package/@sz-sw-le0/object-get-properties.md) ^1.0.0

## Recent versions

- 1.0.0 (latest) — 2021-04-20

## README

# object-diff-properties

Compare property names of two objects `a` and `b`.

Returns additional properties prefixed with `+` and missing properties with `-`.

If both objects have the same property names an empty array is returned.

⚠️ **Caution**
- **Don't rely on the property order returned by this module.**
- It does consider non-enumerable object properties.
- It does not traverse the prototype chain (it uses @sz-sw-le0/object-get-properties).
- It does not care about the property values.

Example usage:

```javascript
const objectDiffProperties = require("object-diff-properties")
const a = {name: "John Doe"}
const b = {age: 35}
const diff = objectDiffProperties(a, b).sort()

console.log(
	diff // logs ["+age", "-name"]
)
```

---
_Source: https://npm.io/package/@sz-sw-le1/object-diff-properties · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
