npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

equalkit

v0.1.1

Published

Tiny, type-safe deep equal and deep clone — handles Map, Set, Date, RegExp, typed arrays, and circular references. Zero dependencies.

Readme

equalkit

All Contributors

Tiny, type-safe deep equal and deep clone — handles Map, Set, Date, RegExp, typed arrays, and circular references. Zero dependencies.

CI npm version bundle size types license

Two jobs you keep needing and keep pulling lodash (or a half-right gist) for: is this deeply equal to that, and give me an independent copy. equalkit does both correctly — including the modern data types and the cyclic structures that trip up fast-deep-equal (stack overflow) and structuredClone (throws on functions) — in one zero-dependency package.

import { equal, clone } from "equalkit";

equal({ a: [1, 2], when: new Date(0) }, { a: [1, 2], when: new Date(0) }); // true

const draft = clone(state); // deep, independent copy — mutate freely

Why equalkit?

  • equal and clone in one tiny module. Consistent type coverage across both.
  • Real-world types. Plain & class objects (prototype preserved on clone), arrays, Date, RegExp, Map, Set, ArrayBuffer, typed arrays, DataView.
  • Cycle-safe. Both functions tolerate circular references — equal won't overflow, clone rewires the cycle to the copy and keeps shared references shared.
  • Sensible primitive rules. NaN equals NaN; +0 equals -0.
  • clone never throws. Functions and symbols are carried over by reference instead of crashing the way structuredClone does.
  • Zero dependencies, ESM + CJS + types, fully typed (clone<T>(x): T).

Install

npm install equalkit
# or: pnpm add equalkit  /  yarn add equalkit  /  bun add equalkit

equal(a, b) → boolean

Deep structural equality.

import { equal } from "equalkit";

equal({ a: 1, b: 2 }, { b: 2, a: 1 });          // true  (key order ignored)
equal([1, 2], [2, 1]);                          // false (array order matters)
equal(new Map([["x", 1]]), new Map([["x", 1]])); // true
equal(new Uint8Array([1, 2]), new Uint8Array([1, 2])); // true
equal(NaN, NaN);                                // true
  • Objects compare own enumerable keys, including symbols.
  • a and b must share a constructor ({x:1}new Point(...)).
  • Map keys and Set members are matched by identity (standard semantics); Map values are compared deeply.

clone(value) → typeof value

Deep, independent copy.

import { clone } from "equalkit";

const a = { list: [1, 2], meta: new Map([["v", 1]]) };
const b = clone(a);
b.list.push(3);          // a.list stays [1, 2]
b.meta.set("v", 99);     // a.meta unchanged
  • Preserves the prototype of class instances (the copy is still instanceof).
  • Copies typed arrays / ArrayBuffer into fresh buffers.
  • Circular references are rewired to the clone; shared references stay shared.
  • Functions and symbols are kept by reference (not deep-copied).

Notes

  • equal is reference-equal fast-pathed and recurses only into objects.
  • Need Map/Set compared by deep member value rather than identity? That's a deliberately different (and ambiguous, O(n²)) operation — out of scope here.

Contributors ✨

This project follows the all-contributors specification. Contributions of any kind are welcome — code, docs, bug reports, ideas, reviews! See the emoji key for how each contribution is recognized, and open a PR or issue to get involved.

Thanks goes to these wonderful people:

License

MIT © Tung Tran