{"id":17993326,"url":"https://github.com/vendicated/virtual-merge","last_synced_at":"2025-09-02T16:44:57.559Z","repository":{"id":142255627,"uuid":"613121099","full_name":"Vendicated/virtual-merge","owner":"Vendicated","description":"A utility library to merge multiple Objects virtually","archived":false,"fork":false,"pushed_at":"2025-02-13T14:41:48.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-21T01:23:41.843Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/virtual-merge","language":"TypeScript","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/Vendicated.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},"funding":{"github":"Vendicated"}},"created_at":"2023-03-12T23:27:32.000Z","updated_at":"2025-02-13T14:41:52.000Z","dependencies_parsed_at":"2023-05-02T05:03:34.515Z","dependency_job_id":null,"html_url":"https://github.com/Vendicated/virtual-merge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vendicated%2Fvirtual-merge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vendicated%2Fvirtual-merge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vendicated%2Fvirtual-merge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vendicated%2Fvirtual-merge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vendicated","download_url":"https://codeload.github.com/Vendicated/virtual-merge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245571895,"owners_count":20637417,"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-29T20:11:00.632Z","updated_at":"2025-03-26T01:31:53.802Z","avatar_url":"https://github.com/Vendicated.png","language":"TypeScript","funding_links":["https://github.com/sponsors/Vendicated"],"categories":[],"sub_categories":[],"readme":"# Virtual Merge\n\nA utility library to merge multiple Objects virtually\n\n```sh\nnpm install virtual-merge\nyarn add virtual-merge\npnpm add virtual-merge\n```\n\nImagine having multiple Objects and wanting to merge those. The usual way to accomplish this is to do\n```js\nconst merged = { ...obj1, ...obj2, ...obj3 };\n```\nHowever, changes made on `merged` will not reflect back to the original Objects.\nThis might be desired, in which case sweet, you don't need this module!\n\nHowever, if you do want those changes to reflect back to the original object, you can use this module!\n\n## Example\n\n```js\nimport virtualMerge from \"virtual-merge\";\n// or commonjs\nconst virtualMerge = require(\"virtual-merge\");\n\nconst obj1 = { im: \"so cool\" };\nconst obj2 = { hamburgers: \"are delicious!\" };\n\nconst merged = virtualMerge(obj1, obj2);\n\nmerged.im = \"so cute!\";\nconsole.log(merged.im); // \"so cute!\"\nconsole.log(obj1.im); // \"so cute!\"\n\nobj1.im = \"awesome!\";\nconsole.log(merged.im); // \"awesome!\"\n\n// new properties work too!\nmerged.someNewProperty = \"wow this is in neither of the objects O_O\";\nconsole.log(merged.someNewProperty); // \"wow this is in neither of the objects O_O\"\nconsole.log(obj1.someNewProperty); // undefined\nconsole.log(obj2.someNewProperty); // undefined\n\n// and of course, the usual object methods still work fine!\nconsole.log(Object.keys(merged)); // [\"someNewProperty\", \"im\", \"hamburgers\"]\nconsole.log(\"im\" in merged); // true\nconsole.log(Object.hasOwn(merged, \"hamburgers\")); // true\n```\n\n## License\n\nMIT - Copyright (c) 2023 Vendicated\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvendicated%2Fvirtual-merge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvendicated%2Fvirtual-merge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvendicated%2Fvirtual-merge/lists"}