deepmerge

Deeply merges the enumerable properties of two or more JavaScript objects into a new object

Library
npm
v4.3.1
2,815 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
53 /100 Fair
Development Activity 52
Maintenance 4
Community 56
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
70 /100 Good
Architecture 65
Code Quality 72
Innovation 55
Learning Curve 88

deepmerge is a small JavaScript utility that recursively merges the enumerable properties of two or more objects, returning a new merged object without mutating either input. Where a key exists in both objects, the value from the later object wins; nested objects are merged recursively rather than overwritten, and arrays are concatenated by default (with a fully customizable merge strategy).

The library exposes both a merge(x, y, options) function for two objects and a merge.all(arrayOfObjects, options) helper for combining any number of objects at once. Its behavior is highly configurable via an arrayMerge function (to overwrite, concatenate, or index-combine arrays), an isMergeableObject predicate (to control which values get deep-merged vs. copied as-is), and a customMerge function (to override merge behavior per property key) — all while remaining a tiny, dependency-free UMD bundle usable in Node.js or directly in the browser.

What You Get

  • A merge(x, y, [options]) function that deeply combines two objects into a new, non-mutated result
  • A merge.all(arrayOfObjects, [options]) helper for merging any number of objects in one call
  • Configurable array-merge strategy (arrayMerge option) — concatenate, overwrite, or index-combine arrays, or supply a fully custom function
  • An isMergeableObject option to control which values are deep-merged versus copied wholesale (useful for class instances or special objects)
  • A customMerge option to override merge behavior for specific property keys
  • A tiny UMD bundle (~723 bytes minified+gzipped) usable via CommonJS, or directly in the browser without a bundler

Common Use Cases

  • Merging default configuration objects with user-supplied overrides while preserving nested defaults
  • Combining multiple partial state or options objects into a single object in application or library code
  • Merging JSON configuration files (e.g. environment-specific config layered over base config)
  • Building plugin or middleware systems where each layer contributes partial configuration that must be deeply combined

Under The Hood

Architecture - deepmerge is implemented as a single, compact index.js (~106 lines) exporting a recursive merge function plus a merge.all wrapper; the core algorithm walks the target and source objects’ keys, recursively merging nested mergeable objects and delegating array handling to a pluggable arrayMerge strategy function, with cloneUnlessOtherwiseSpecified ensuring untouched values are still cloned to avoid mutating inputs. Tech Stack - Plain JavaScript (with a small TypeScript declaration file, index.d.ts) built and bundled via Rollup into a UMD module, with zero runtime dependencies, making it safe to use in both Node.js and browser contexts without a build step. Code Quality - The test/ directory covers custom array-merge strategies, custom isMergeableObject predicates, merge.all, and — notably — a dedicated prototype-poisoning.js test guarding against __proto__-based prototype pollution attacks, a security-conscious addition given how widely the library is used to merge untrusted input; despite no commits since 2023, the codebase is stable and the API has not needed to change. API Design - The API is minimal and predictable (merge, merge.all, plus three well-documented options), with clear semantics (later value wins, arrays concatenate by default, nested objects merge recursively) that make it a near drop-in replacement wherever Object.assign-style shallow merging falls short.

Used by 23 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

166

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
31
Repo Health
70
Technical
64
Dependency
Built with
TypeScript 76%
MDX 18%
Updated 1 years ago
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,650

Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.

View details
67
Repo Health
76
Technical
62
Dependency
Built with
JavaScript 90%
Updated 3 weeks ago
TypeScript
92%
MIT

Dittofeed

Automation · Marketing

2,968

Open-source omni-channel customer engagement platform for automating transactional and marketing messages via email, SMS, WhatsApp, Slack, and mobile push.

View details
54
Repo Health
75
Technical
62
Dependency
Built with
TypeScript 92%
Updated 6 months ago
TypeScript
98%
Other

Kibana

Analytics · Monitoring

21,301

Your open source window into the Elastic Stack — query, visualize, and act on data stored in Elasticsearch with real-time dashboards, AI-assisted search, and automated alerting.

View details
98
Repo Health
87
Technical
63
Dependency
Built with
TypeScript 98%
Updated 4 days ago
Clojure
70%
AGPL 3.0

Logseq

Knowledge Management · Note Taking

45,069

A privacy-first, open-source knowledge graph platform combining Markdown, Org-mode, bidirectional linking, and local-first storage for building your second brain.

View details
92
Repo Health
82
Technical
68
Dependency
Built with
Clojure 70%
OCaml 12%
Updated 4 days ago
TypeScript
97%
MPL 2.0

Logto

Authentication

14,639

Open-source auth infrastructure for SaaS and AI apps with OIDC, SAML, and RBAC

View details
92
Repo Health
83
Technical
64
Dependency
Built with
TypeScript 97%
Updated 4 days ago
TypeScript
51%
Other

Mattermost

Collaboration · Devops · Team Chat

39,203

Open core, self-hosted team collaboration with chat, AI agents, voice calling, and deep DevOps integrations — all under your control.

View details
96
Repo Health
87
Technical
65
Dependency
Built with
TypeScript 51%
Go 40%
Updated 4 days ago
TypeScript
90%
Apache 2.0

Nanobrowser

AI Assistants · Automation · Productivity

13,834

Open-source Chrome extension for AI-powered web automation — run multi-agent browser workflows locally using your own LLM API keys, free from cloud subscriptions.

View details
59
Repo Health
66
Technical
72
Dependency
Built with
TypeScript 90%
Updated 1 months ago
Go
82%
GPL 3.0

Navidrome

File Storage · Music Audio

23,855

Run your own personal Spotify — stream your entire music collection from any device, anywhere, forever.

View details
91
Repo Health
81
Technical
69
Dependency
Built with
Go 82%
JavaScript 15%
Updated 4 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers