quick-object-diff
v1.0.0
Published
Fast, zero-dependency deep object and array difference calculator generating structural patches and change summaries.
Maintainers
Readme
⚡ quick-object-diff
Fast, zero-dependency deep object and array difference calculator generating structural patches and change summaries.
✨ Features
- ⚡ Zero Dependencies — Ultra-lightweight (~1.5 KB), pure native JavaScript.
- 🔍 Deep Inspection — Recursively compares deeply nested objects and arrays.
- 📝 Structured Output — Separates changes into
added,deleted,updated, and patchoperations. - 📦 Dual ESM & CommonJS — Works in Node.js, Vite, Next.js, and browsers.
📥 Installation
npm install quick-object-diff🚀 Quick Start
import { diffObjects } from 'quick-object-diff';
const oldUser = { name: 'Alice', age: 25, role: 'viewer' };
const newUser = { name: 'Alice', age: 26, role: 'admin', city: 'London' };
const diff = diffObjects(oldUser, newUser);
console.log(diff.updated); // { age: { from: 25, to: 26 }, role: { from: 'viewer', to: 'admin' } }
console.log(diff.added); // { city: 'London' }
console.log(diff.hasChanges); // true💖 Support the Project
If you find this package useful, consider sponsoring its ongoing development: 👉 Sponsor @Piratha97 on GitHub Sponsors
📄 License
MIT © 2026 Pirapaakaran Pirathapan
