# is-equal

> Are these two values conceptually equal?

Latest version **1.8.0** (published 2026-06-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-equal
pnpm add is-equal
yarn add is-equal
bun add is-equal
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.8.0 |
| Published | 2026-06-22 |
| First published | 2014-01-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 0.4 |
| Dependencies | 23 |
| Unpacked size | 144.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 59 |
| Author | Jordan Harband |
| Maintainers | ljharb |
| Keywords | equal, is, compare, comparison, equality |

## Links

- npm: https://www.npmjs.com/package/is-equal
- Repository: https://github.com/inspect-js/is-equal
- Issues: https://github.com/inspect-js/is-equal/issues
- Funding: https://github.com/sponsors/ljharb
- npm.io page: https://npm.io/package/is-equal

## Dependencies (23)

- [hasown](https://npm.io/package/hasown.md) ^2.0.4
- [isarray](https://npm.io/package/isarray.md) ^2.0.5
- [is-regex](https://npm.io/package/is-regex.md) ^1.2.1
- [is-bigint](https://npm.io/package/is-bigint.md) ^1.1.0
- [is-string](https://npm.io/package/is-string.md) ^1.1.1
- [is-symbol](https://npm.io/package/is-symbol.md) ^1.1.1
- [has-bigints](https://npm.io/package/has-bigints.md) ^1.1.0
- [has-symbols](https://npm.io/package/has-symbols.md) ^1.1.0
- [is-callable](https://npm.io/package/is-callable.md) ^1.2.7
- [side-channel](https://npm.io/package/side-channel.md) ^1.1.1
- [is-date-object](https://npm.io/package/is-date-object.md) ^1.1.0
- [object-inspect](https://npm.io/package/object-inspect.md) ^1.13.4
- [object.entries](https://npm.io/package/object.entries.md) ^1.1.9
- [es-get-iterator](https://npm.io/package/es-get-iterator.md) ^1.1.3
- [es-to-primitive](https://npm.io/package/es-to-primitive.md) ^1.3.1
- [is-number-object](https://npm.io/package/is-number-object.md) ^1.1.1
- [which-collection](https://npm.io/package/which-collection.md) ^1.0.2
- [is-arrow-function](https://npm.io/package/is-arrow-function.md) ^2.0.3
- [is-boolean-object](https://npm.io/package/is-boolean-object.md) ^1.2.2
- [functions-have-names](https://npm.io/package/functions-have-names.md) ^1.2.3
- [is-generator-function](https://npm.io/package/is-generator-function.md) ^1.1.2
- [object.getprototypeof](https://npm.io/package/object.getprototypeof.md) ^1.0.7
- [which-boxed-primitive](https://npm.io/package/which-boxed-primitive.md) ^1.1.1

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.8.0 (latest) — 2026-06-22
- 1.7.0 — 2023-10-21
- 1.6.5 — 2023-10-21
- 1.6.4 — 2022-01-10
- 1.6.3 — 2021-08-07
- 1.6.2 — 2021-05-08
- 1.6.1 — 2019-11-29
- 1.6.0 — 2019-11-12
- 1.5.5 — 2017-02-06
- 1.5.4 — 2017-01-26
- 1.5.3 — 2016-05-24
- 1.5.2 — 2016-05-18
- 1.5.1 — 2016-02-22
- 1.5.0 — 2016-02-16
- 1.4.2 — 2015-12-16
- … 12 more at https://npm.io/package/is-equal/versions

## README

# is-equal <sup>[![Version Badge][2]][1]</sup>

[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][5]][6]
[![dev dependency status][7]][8]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

[![npm badge][11]][1]

Are these two values conceptually equal?

## Example

```js
var isEqual = require('is-equal');
var assert = require('assert');

var primitives = [true, false, undefined, 42, 'foo'];
primitives.forEach(function (primitive) {
	assert.equal(isEqual(primitive, primitive), true);
});
assert.equal(isEqual(/a/g, /a/g), true);
assert.equal(isEqual(/a/g, new RegExp('a', 'g')), true);
assert.equal(isEqual({ a: 2 }, { a: 2 }), true);
assert.equal(isEqual([1, [2, 3], 4], [1, [2, 3], 4]), true);
var timestamp = Date.now();
assert.equal(isEqual(new Date(timestamp), new Date(timestamp)), true);
```

## Want to know *why* two values are not equal?
Will return an empty string if `isEqual` would return `true` - otherwise will return a non-empty string that hopefully explains the reasoning.

```
var whyNotEqual = require('is-equal/why');

assert.equal(whyNotEqual(1, 1), '');
assert.equal(
  whyNotEqual({ a: 1 }, { a: 2 }),
  'value at key "a" differs: numbers are different: 1 !== 2'
);
```

## Tests
Simply clone the repo, `npm install`, and run `npm test`

[1]: https://npmjs.org/package/is-equal
[2]: https://versionbadg.es/inspect-js/is-equal.svg
[5]: https://david-dm.org/inspect-js/is-equal.svg
[6]: https://david-dm.org/inspect-js/is-equal
[7]: https://david-dm.org/inspect-js/is-equal/dev-status.svg
[8]: https://david-dm.org/inspect-js/is-equal#info=devDependencies
[11]: https://nodei.co/npm/is-equal.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/is-equal.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/is-equal.svg
[downloads-url]: https://npm-stat.com/charts.html?package=is-equal
[codecov-image]: https://codecov.io/gh/inspect-js/is-equal/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/is-equal/
[actions-image]: https://img.shields.io/github/check-runs/inspect-js/is-equal/main
[actions-url]: https://github.com/inspect-js/is-equal/actions

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