{"id":16696572,"url":"https://github.com/karolis-sh/esbuild-plugin-json-merge","last_synced_at":"2025-06-25T01:32:52.620Z","repository":{"id":43738160,"uuid":"386194039","full_name":"karolis-sh/esbuild-plugin-json-merge","owner":"karolis-sh","description":"Merging multiple JSON sources into one via esbuild pipeline","archived":false,"fork":false,"pushed_at":"2023-12-08T22:55:04.000Z","size":1567,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-26T00:52:41.967Z","etag":null,"topics":["esbuild","esbuild-plugin","json","merge"],"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/karolis-sh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-07-15T06:52:16.000Z","updated_at":"2023-10-02T00:55:12.000Z","dependencies_parsed_at":"2025-02-16T10:33:12.842Z","dependency_job_id":"a4ac8cef-5bad-44dd-bd38-aa5e4c2f2924","html_url":"https://github.com/karolis-sh/esbuild-plugin-json-merge","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/karolis-sh/esbuild-plugin-json-merge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolis-sh%2Fesbuild-plugin-json-merge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolis-sh%2Fesbuild-plugin-json-merge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolis-sh%2Fesbuild-plugin-json-merge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolis-sh%2Fesbuild-plugin-json-merge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karolis-sh","download_url":"https://codeload.github.com/karolis-sh/esbuild-plugin-json-merge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolis-sh%2Fesbuild-plugin-json-merge/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261785401,"owners_count":23209295,"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":["esbuild","esbuild-plugin","json","merge"],"created_at":"2024-10-12T17:44:08.765Z","updated_at":"2025-06-25T01:32:52.598Z","avatar_url":"https://github.com/karolis-sh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esbuild-plugin-json-merge\n\n[![npm version][package-version-badge]][package-version]\n[![Node.js CI](https://github.com/karolis-sh/esbuild-plugin-json-merge/actions/workflows/node.js.yml/badge.svg)](https://github.com/karolis-sh/esbuild-plugin-json-merge/actions/workflows/node.js.yml)\n[![License: MIT](https://img.shields.io/badge/license-mit-yellow.svg)](https://opensource.org/licenses/MIT)\n\nMerging multiple JSON sources into one via [esbuild](https://esbuild.github.io/)\npipeline.\n\n## Installation\n\n```bash\nnpm i esbuild-plugin-json-merge -D\n```\n\nor\n\n```bash\nyarn add esbuild-plugin-json-merge --dev\n```\n\n## Usage\n\n```js\nconst esbuild = require('esbuild');\nconst jsonMerge = require('esbuild-plugin-json-merge');\n\nconst { version, name, description } = require('./package.json');\n\nesbuild\n  .build({\n    entryPoints: ['src/index.js'],\n    outdir: 'build',\n    plugins: [\n      jsonMerge({\n        entryPoints: ['src/manifest.json', { version, name, description }],\n        outfile: 'manifest.json',\n      }),\n    ],\n  })\n  .catch(() =\u003e process.exit(1));\n```\n\n## Options\n\n### entryPoints\n\nType: `(string | object)[]`\n\nAn array of [glob](https://www.npmjs.com/package/glob) patterns or JSON objects\nthat should be merged.\n\n### outfile\n\nType: `string`\n\nJSON output destination.\n\n### merge\n\nType: `(items: JSONValue[]) =\u003e JSONValue`\n\nBy default the merge function uses `Object.assign`.\n\n```js\nconst esbuild = require('esbuild');\nconst jsonMerge = require('esbuild-plugin-json-merge');\nconst { defaultComposer } = require('default-composer');\n\nconst { version, name, description } = require('./package.json');\n\nesbuild\n  .build({\n    entryPoints: ['src/index.js'],\n    outdir: 'build',\n    plugins: [\n      jsonMerge({\n        entryPoints: ['src/manifest.json', { version, name, description }],\n        outfile: 'manifest.json',\n        merge: (items) =\u003e defaultComposer(...items), //Custom merge\n      }),\n    ],\n  })\n  .catch(() =\u003e process.exit(1));\n```\n\n[package-version-badge]: https://badge.fury.io/js/esbuild-plugin-json-merge.svg\n[package-version]: https://www.npmjs.com/package/esbuild-plugin-json-merge\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarolis-sh%2Fesbuild-plugin-json-merge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarolis-sh%2Fesbuild-plugin-json-merge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarolis-sh%2Fesbuild-plugin-json-merge/lists"}