{"id":17531158,"url":"https://github.com/bartozzz/json-overrides","last_synced_at":"2026-01-19T13:33:05.961Z","repository":{"id":9018360,"uuid":"60553782","full_name":"Bartozzz/json-overrides","owner":"Bartozzz","description":"Creates name-specific manifests from a plain object. Overrides object properties with name-specific ones and removes the overrides property.","archived":false,"fork":false,"pushed_at":"2023-01-07T03:55:55.000Z","size":1925,"stargazers_count":0,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"development","last_synced_at":"2025-03-13T21:06:56.981Z","etag":null,"topics":["extend","json","json-extend","json-files","object","override"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/json-overrides","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/Bartozzz.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}},"created_at":"2016-06-06T19:08:48.000Z","updated_at":"2021-08-03T04:59:46.000Z","dependencies_parsed_at":"2023-01-13T15:07:17.041Z","dependency_job_id":null,"html_url":"https://github.com/Bartozzz/json-overrides","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/Bartozzz%2Fjson-overrides","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bartozzz%2Fjson-overrides/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bartozzz%2Fjson-overrides/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bartozzz%2Fjson-overrides/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bartozzz","download_url":"https://codeload.github.com/Bartozzz/json-overrides/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247550924,"owners_count":20957026,"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","json-extend","json-files","object","override"],"created_at":"2024-10-20T17:23:05.118Z","updated_at":"2026-01-19T13:33:05.954Z","avatar_url":"https://github.com/Bartozzz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003ejson-overrides\u003c/h1\u003e\n\n[![Default CI/CD](https://github.com/Bartozzz/json-overrides/workflows/Default%20CI/CD/badge.svg)](https://github.com/Bartozzz/json-overrides/actions)\n[![Known Vulnerabilities](https://snyk.io/test/github/Bartozzz/json-overrides/badge.svg?targetFile=package.json)](https://snyk.io/test/github/Bartozzz/json-overrides?targetFile=package.json)\n[![npm package size](https://img.badgesize.io/Bartozzz/json-overrides/master/dist/index.js?compression=gzip)](https://www.npmjs.com/package/json-overrides)\n[![npm version](https://img.shields.io/npm/v/json-overrides.svg)](https://www.npmjs.com/package/json-overrides)\n[![npm dependency Status](https://david-dm.org/Bartozzz/json-overrides.svg)](https://www.npmjs.com/package/json-overrides)\n[![npm downloads](https://img.shields.io/npm/dt/json-overrides.svg)](https://www.npmjs.com/package/json-overrides)\n\u003cbr\u003e\n\n**json-overrides** creates name-specific manifests from a plain object. Overrides object properties with name-specific ones and removes the overrides property.\n\n\u003c/div\u003e\n\n## Installation\n\n```bash\n$ npm install json-overrides\n```\n\n## Usage\n\n```\noverride(json: string | Overridable, name: string): Object\n```\n\n```javascript\nimport override from \"json-overrides\";\n\nlet obj = {\n  a: \"Default a value\",\n  b: \"Default b value\",\n\n  overrides: {\n    projectA: {\n      a: \"a value for projectA\",\n    },\n\n    projectB: {\n      a: \"a value for projectB\",\n    },\n\n    projectC: {\n      a: \"a value for projectC\",\n      b: \"b value for projectC\",\n    },\n  },\n};\n\noverride(obj, \"projectA\");\n// {\n//   a: \"a value for projectA\",\n//   b: \"Default b value\"\n// }\n\noverride(obj, \"projectB\");\n// {\n//   a: \"a value for projectB\",\n//   b: \"Default b value\"\n// }\n\noverride(obj, \"projectC\");\n// {\n//   a: \"a value for projectC\",\n//   b: \"b value for projectC\"\n// }\n\noverride(obj, \"projectD\");\n// Error: Overrides for projectD not found\n\noverride(123, \"projectD\");\n// TypeError: Expected JSON to be an object (got number)\n\noverride(true, \"projectD\");\n// TypeError: Expected JSON to be an object (got boolean)\n```\n\n\u003e **Note:** you can pass valid serialized objects as argument, e.g. `override(JSON.stringify(object), key\");`.\n\n## Tests\n\n```bash\n$ npm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartozzz%2Fjson-overrides","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbartozzz%2Fjson-overrides","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartozzz%2Fjson-overrides/lists"}