{"library":"merge-deep","title":"Merge Deep","description":"merge-deep is a JavaScript utility designed to recursively merge the properties of one or more source objects into a target object. It is currently at stable version 3.0.3, maintaining a mature and relatively stable codebase. The library's core functionality is to perform a deep merge, meaning it traverses nested objects and combines their properties rather than simply overwriting them, which is a common behavior in shallow merge operations. This ensures a comprehensive union of object structures. It draws its implementation foundation from the `mout` library's merge utility. While a specific release cadence isn't explicitly defined, the project typically receives updates for maintenance or minor enhancements. A key differentiator is its commitment to a pure function approach, aiming to return a new merged object without directly mutating the input objects, providing a predictable and side-effect-free way to combine complex configurations or data structures.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install merge-deep"],"cli":null},"imports":["const merge = require('merge-deep');","import merge from 'merge-deep';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const merge = require('merge-deep');\n\nconst obj1 = {\n  a: {\n    b: {\n      c: 'c1',\n      d: 'd1'\n    },\n    x: 1\n  }\n};\n\nconst obj2 = {\n  a: {\n    b: {\n      e: 'e2',\n      f: 'f2'\n    },\n    y: 2\n  },\n  z: 3\n};\n\n// Basic deep merge of two objects\nconst merged = merge(obj1, obj2);\nconsole.log('Merged two objects:', merged);\n// Expected: { a: { b: { c: 'c1', d: 'd1', e: 'e2', f: 'f2' }, x: 1, y: 2 }, z: 3 }\n\n// Demonstrate merging multiple objects into a new empty object\nconst obj3 = { a: { b: { g: 'g3' } } };\nconst mergedMany = merge({}, obj1, obj2, obj3);\nconsole.log('Merged multiple objects:', mergedMany);\n// Expected to deeply merge properties from obj1, obj2, obj3 into a new empty object.","lang":"javascript","description":"This quickstart demonstrates how to import and use `merge-deep` to perform a basic deep merge on two objects and then on multiple objects into a new target.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}