{"id":16696567,"url":"https://github.com/karolis-sh/rollup-plugin-json-merge","last_synced_at":"2026-05-02T04:37:59.185Z","repository":{"id":48844938,"uuid":"376636413","full_name":"karolis-sh/rollup-plugin-json-merge","owner":"karolis-sh","description":"A Rollup plugin to merge multiple JSON sources into one","archived":false,"fork":false,"pushed_at":"2021-07-08T20:52:06.000Z","size":142,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T08:46:11.342Z","etag":null,"topics":["json","merge","rollup","rollup-plugin"],"latest_commit_sha":null,"homepage":"","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/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}},"created_at":"2021-06-13T20:40:42.000Z","updated_at":"2022-12-17T22:30:07.000Z","dependencies_parsed_at":"2022-09-04T19:20:33.810Z","dependency_job_id":null,"html_url":"https://github.com/karolis-sh/rollup-plugin-json-merge","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":"karolis-sh/template-javascript","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolis-sh%2Frollup-plugin-json-merge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolis-sh%2Frollup-plugin-json-merge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolis-sh%2Frollup-plugin-json-merge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karolis-sh%2Frollup-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/rollup-plugin-json-merge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247284918,"owners_count":20913691,"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":["json","merge","rollup","rollup-plugin"],"created_at":"2024-10-12T17:44:07.695Z","updated_at":"2026-05-02T04:37:59.159Z","avatar_url":"https://github.com/karolis-sh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rollup-plugin-json-merge\n\n[![npm version][package-version-badge]][package-version]\n[![Node.js CI](https://github.com/karolis-sh/rollup-plugin-json-merge/actions/workflows/node.js.yml/badge.svg)](https://github.com/karolis-sh/rollup-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\n🍣 A Rollup plugin to merge multiple JSON sources into one.\n\n## Install\n\nUsing npm:\n\n```console\nnpm i rollup-plugin-json-merge --save-dev\n```\n\nUsing yarn:\n\n```console\nyarn add rollup-plugin-json-merge -D\n```\n\n## Usage\n\nCreate a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files)\nand import the plugin:\n\n```js\nimport merge from 'rollup-plugin-json-merge';\nimport { name, version, description } from './package.json';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    dir: 'output',\n    format: 'cjs',\n  },\n  plugins: [\n    merge({\n      input: [{ name, version, description }, 'src/manifest.json', 'src/data/*.json'],\n      fileName: 'manifest.json',\n    }),\n  ],\n};\n```\n\nThen call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference)\nor the [API](https://www.rollupjs.org/guide/en/#javascript-api).\n\nThe configuration above will collect JSON values from given input option and\nbuild the output file using `Object.assign`.\n\n## Options\n\n### `input`\n\nType: `(String | JSONValue)` | `Array[...(String | JSONValue)]`\u003cbr\u003e\nDefault: `[]`\n\n[Glob](https://www.npmjs.com/package/glob) style string pattern or a JSON object\nor an array of a mix of those to construct a single output from.\n\n### `fileName`\n\nType: `String`\u003cbr\u003e\nDefault: `output.json`\n\nOutput filename for the merged JSON.\n\n### `merge`\n\nType: `Function`\u003cbr\u003e\nDefault: `(items) =\u003e Object.assign(...items)`\n\nThe function responsible for merging given items.\n\n## License\n\n[MIT](/LICENSE)\n\n[package-version-badge]: https://badge.fury.io/js/rollup-plugin-json-merge.svg\n[package-version]: https://www.npmjs.com/package/rollup-plugin-json-merge\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarolis-sh%2Frollup-plugin-json-merge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarolis-sh%2Frollup-plugin-json-merge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarolis-sh%2Frollup-plugin-json-merge/lists"}