{"id":20252410,"url":"https://github.com/ivandotv/jme","last_synced_at":"2025-08-30T23:41:18.181Z","repository":{"id":35162658,"uuid":"213996479","full_name":"ivandotv/jme","owner":"ivandotv","description":"Fully or partially merge JSON files via the command line.","archived":false,"fork":false,"pushed_at":"2025-04-04T00:51:59.000Z","size":554,"stargazers_count":2,"open_issues_count":15,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T23:16:32.148Z","etag":null,"topics":["extend","json","merge","typescript"],"latest_commit_sha":null,"homepage":"","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/ivandotv.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":"2019-10-09T18:39:35.000Z","updated_at":"2024-04-29T13:02:19.000Z","dependencies_parsed_at":"2024-04-29T14:27:28.729Z","dependency_job_id":"ed7c2934-e44b-49df-b33f-05d520d7eb4a","html_url":"https://github.com/ivandotv/jme","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivandotv%2Fjme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivandotv%2Fjme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivandotv%2Fjme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivandotv%2Fjme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivandotv","download_url":"https://codeload.github.com/ivandotv/jme/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312133,"owners_count":21082638,"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":["extend","json","merge","typescript"],"created_at":"2024-11-14T10:16:35.791Z","updated_at":"2025-04-10T23:16:37.703Z","avatar_url":"https://github.com/ivandotv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JME CLI\n\n[![CircleCI](https://img.shields.io/circleci/build/github/ivandotv/jme/master)](https://circleci.com/gh/ivandotv/jme)\n[![Codecov](https://img.shields.io/codecov/c/github/ivandotv/jme)](https://codecov.io/gh/ivandotv/jme)\n[![NPM](https://img.shields.io/npm/l/jme)](https://www.npmjs.com/package/jme)\n\nFully or **partially** merge JSON files via the command line.\n\n## Installation\n\n```bash\nnpm install jme\n```\n\nUsage\n\n```bash\njme file-1.json file-2.json file-3.json \u003e merged.json\n```\n\n`file-3.json` will be merged with `file-2.json` and the result will be merged with `file-1.json`\nThe first file is the target file however, files are never modified, rather the merge result is sent to standard out.\n\nYou can pass in any number of files to be merged.\n\n## Partial merging\n\nIn addition to fully merging json files, you can merge only some of the\n`properties` / `paths` on the JSON object.\n\nGiven these files:\n\n```js\n// test-1.json\n{\n  \"prop1\": {\n    \"id\": 1,\n    \"tags\": [1, 2, 3],\n    \"level1\": {\n      \"prop1\": \"t1\",\n      \"customProp1\": \"t1\",\n      \"level2\": { // override this path with the same path from the other files.\n        \"prop1\": \"t1\",\n        \"customProp1\": \"t1\"\n      }\n    }\n  }\n}\n\n\n// test-2.json\n{\n  \"prop1\": {\n    \"id\": 2,\n    \"tags\": [4, 5, 6],\n    \"level1\": {\n      \"prop1\": \"t2\",\n      \"customProp2\": \"t2\",\n      \"level2\": { //merge only this path\n        \"prop1\": \"t2\",\n        \"customProp2\": \"t2\"\n      }\n    }\n  }\n}\n```\n\nYou can choose to merge only a part of the file (in this case `prop1.level1.level2`)\n\n```bash\njme test-1.json test-2.json -p 'prop1.level1.level2'\n```\n\nresult:\n\n```js\n{\n  \"prop1\": {\n    \"id\": 1,\n    \"tags\": [1, 2, 3],\n    \"level1\": {\n      \"prop1\": \"t1\",\n      \"customProp1\": \"t1\",\n      \"level2\": {       //only this path 'prop1.level1.level2' is merged\n        \"prop1\": \"t2\" // comes from test-2.json\n        \"customProp2\": \"t2\",// comes from test-2.json\n        \"customProp1\": \"t1\" // comes from test-1.json\n      }\n    }\n  }\n}\n\n```\n\nYou can partially merge multiple paths, just make sure to separate then with comma `-p 'prop1.level1.level2,some.other.path,yet.some.other.path'`\n\nIf the `path` does not exist in one of the files program will report an error and the merge process will not be executed. However, you can pass an additional flag `-u` or `--allow-undefined` to allow `undefined` paths in the files. In that case, if the `path` does not exist in the file, that file will be skipped for that particular `path`.\n\n### Full path override\n\nYou can also override the path on the last file target ( `-o` or `--override`)\n\nIn the next example chosen `path` will be merged from `test-3.json` into `test-2.json` and then that same `path` will be **overridden** in `test-1.json` (no merging with the `test-1.json`)\n\nExample:\n\n```bash\njme test-1.json test-2.json test-3.json --path 'prop1.level1.level2' --override\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivandotv%2Fjme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivandotv%2Fjme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivandotv%2Fjme/lists"}