{"id":16644165,"url":"https://github.com/75lb/deep-merge","last_synced_at":"2025-03-21T15:32:44.207Z","repository":{"id":57093798,"uuid":"375328904","full_name":"75lb/deep-merge","owner":"75lb","description":"Deep merge config objects","archived":false,"fork":false,"pushed_at":"2024-07-31T20:40:39.000Z","size":170,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T02:51:21.208Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/75lb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-09T11:20:15.000Z","updated_at":"2024-09-23T23:58:46.000Z","dependencies_parsed_at":"2024-10-12T08:10:40.439Z","dependency_job_id":null,"html_url":"https://github.com/75lb/deep-merge","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fdeep-merge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fdeep-merge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fdeep-merge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fdeep-merge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/75lb","download_url":"https://codeload.github.com/75lb/deep-merge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244822760,"owners_count":20516161,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T08:10:37.710Z","updated_at":"2025-03-21T15:32:43.833Z","avatar_url":"https://github.com/75lb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![view on npm](https://badgen.net/npm/v/@75lb/deep-merge)](https://www.npmjs.org/package/@75lb/deep-merge)\n[![npm module downloads](https://badgen.net/npm/dt/@75lb/deep-merge)](https://www.npmjs.org/package/@75lb/deep-merge)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/deep-merge)](https://github.com/75lb/deep-merge/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/deep-merge)](https://github.com/75lb/deep-merge/network/dependents?dependent_type=PACKAGE)\n[![Node.js CI](https://github.com/75lb/deep-merge/actions/workflows/node.js.yml/badge.svg)](https://github.com/75lb/deep-merge/actions/workflows/node.js.yml)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)\n\n# @75lb/deep-merge\n\nDeep-merge the values of one object structure into another. Similar to [`Object.assign()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) except it processes the full depth of the object structure, not only the top level. Useful for merging config.\n\n## Synopsis\n\n```js\nimport deepMerge from '@75lb/deep-merge'\n\n```\n\n### Simple\n\nTypical example merging four objects. Input:\n\n```js\ndeepMerge(\n  { port: 8000, data: { animal: 'cow' } },\n  { stack: ['one'] },\n  { stack: ['two'], help: true },\n  { data: { animal: 'bat', metal: 'iron' } }\n)\n```\n\nResult\n\n```js\n{\n  port: 8000,\n  stack: ['two'],\n  help: true,\n  data: { animal: 'bat', metal: 'iron' }\n}\n```\n\n### Arrays\n\nEmpty arrays are ignored and not merged in. Input:\n\n```js\ndeepMerge(\n  { stack: ['one'] },\n  { stack: [] }\n)\n```\n\nResult:\n\n\n```js\n{ stack: ['one'] }\n```\n\nHowever, if the later array contains one or more values the later array will *replace* the original: \n\n```js\ndeepMerge(\n  { stack: ['one'] },\n  { stack: ['two'] }\n)\n```\n\nResult:\n\n```js\n{ stack: ['two'] }\n```\n\n### Load anywhere\n\nThis library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.\n\nWithin a Node.js ECMAScript Module:\n\n```js\nimport deepMerge from '@75lb/deep-merge'\n```\n\nWithin an modern browser ECMAScript Module:\n\n```js\nimport deepMerge from './node_modules/@75lb/deep-merge/dist/index.mjs'\n```\n\n* * *\n\n\u0026copy; 2018-24 [Lloyd Brookes](https://github.com/75lb) \\\u003c75pound@gmail.com\\\u003e.\n\nTested by [test-runner](https://github.com/test-runner-js/test-runner). Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F75lb%2Fdeep-merge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F75lb%2Fdeep-merge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F75lb%2Fdeep-merge/lists"}