···2233<samp>
4455-# object-identity
55+# object-identity [](https://licenses.dev/npm/object-identity)
6677</samp>
8899**A utility that provides a stable identity of an object**
10101111-<a href="https://npm-stat.com/charts.html?package=object-identity">
1212- <img src="https://badgen.net/npm/dm/object-identity?color=black&label=npm%20downloads" alt="js downloads">
1313-</a>
1414-<a href="https://licenses.dev/npm/object-identity">
1515- <img src="https://licenses.dev/b/npm/object-identity?style=dark" alt="licenses" />
1616-</a>
1717-<a href="https://unpkg.com/object-identity/index.mjs">
1818- <img src="https://img.badgesize.io/https://unpkg.com/object-identity/index.mjs?compression=gzip&label=gzip&color=black" alt="gzip size" />
1919-</a>
2020-<a href="https://unpkg.com/object-identity/index.mjs">
2121- <img src="https://img.badgesize.io/https://unpkg.com/object-identity/index.mjs?compression=brotli&label=brotli&color=black" alt="brotli size" />
2222-</a>
2323-2424-<br>
2525-<br>
2626-2711<sup>
28122929-This is free to use software, but if you do like it, consisder supporting me ❤️
1313+This is free to use software, but if you do like it, consider supporting me ❤️
30143115[](https://github.com/sponsors/maraisr)
3216[](https://www.buymeacoffee.com/marais)
···4024- ✅ **Intuitive**
4125- 🌪 **Recursive/Circular support**
4226- 🏎 **Performant** — check the [benchmarks](#-benchmark).
4343-- 🪶 **Lightweight** — a mere 387B and no [dependencies](https://npm.anvaka.com/#/view/2d/object-identity/).
2727+- 🪶 **Lightweight** — a mere 387B and no
2828+ [dependencies](https://npm.anvaka.com/#/view/2d/object-identity/).
44294530## 🚀 Usage
3131+3232+> Avaliable on [jsr](https://jsr.io/@mr/object-identity),
3333+> [NPM](https://npmjs.com/package/object-identity) and
3434+> [deno.land](https://deno.land/x/object_identity)
46354736```ts
4837import { identify } from 'object-identity';
3838+// or
3939+import { identify } from 'https://deno.land/x/object_identity';
49405041// ~> identity the object
5142const id1 = identify({ a: new Set(['b', 'c', new Map([['d', 'e']])]) });
···58495950## 💨 Benchmark
60516161-> via the [`/bench`](/bench) directory with Node v18.16.1 (Apple M1 Pro)
5252+> via the [`/bench`](/bench) directory with deno 1.41.3
62536354```
6464-✔ object-identity ~ 55,252,648 ops/sec ± 0.11%
6565-✔ object-hash ~ 96,936 ops/sec ± 0.01%
6666-✔ json-stable-stringify ~ 605,425 ops/sec ± 0.02%
5555+✔ object-identity ~ 14,646,170 ops/sec ± 0.10%
5656+✔ object-hash ~ 144,060 ops/sec ± 0.01%
5757+✔ json-stable-stringify ~ 638,559 ops/sec ± 0.01%
6758```
68596969-> ^ `object-identity` is not as feature-full it's alternatives, specifically around `function` values and other node
7070-> builtins. So take this benchmark with a grain of salt, as it's only testing "json-like" payloads.
6060+> ^ `object-identity` is not as feature-full it's alternatives, specifically around `function`
6161+> values and other node builtins. So take this benchmark with a grain of salt, as it's only testing
6262+> "json-like" payloads.
71637264## License
7365