{"id":23818727,"url":"https://github.com/tettusud/merge-jsons-webpack-plugin","last_synced_at":"2026-03-14T23:31:44.453Z","repository":{"id":15237013,"uuid":"77769506","full_name":"tettusud/merge-jsons-webpack-plugin","owner":"tettusud","description":"This plugin is used to merge json files into single json file,using glob or file names","archived":false,"fork":false,"pushed_at":"2023-01-07T10:11:03.000Z","size":1783,"stargazers_count":36,"open_issues_count":35,"forks_count":20,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-09-20T00:33:27.922Z","etag":null,"topics":["angular","json","react","spa","webpack-plugin"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/merge-jsons-webpack-plugin","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tettusud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-01T07:13:47.000Z","updated_at":"2024-10-09T08:16:22.000Z","dependencies_parsed_at":"2023-01-13T18:19:36.410Z","dependency_job_id":null,"html_url":"https://github.com/tettusud/merge-jsons-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/tettusud/merge-jsons-webpack-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tettusud%2Fmerge-jsons-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tettusud%2Fmerge-jsons-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tettusud%2Fmerge-jsons-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tettusud%2Fmerge-jsons-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tettusud","download_url":"https://codeload.github.com/tettusud/merge-jsons-webpack-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tettusud%2Fmerge-jsons-webpack-plugin/sbom","scorecard":{"id":875451,"data":{"date":"2025-08-11","repo":{"name":"github.com/tettusud/merge-jsons-webpack-plugin","commit":"5fb87ba0dfd7e479ccce29d45b35a0b5fd6a1be6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 2/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 14 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"73 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-3wcq-x3mq-6r9p","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-6h5x-7c5m-7cr7","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q","Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-86wf-436m-h424","Warn: Project is vulnerable to: GHSA-8w57-jfpm-945m","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-8g7p-74h8-hg48","Warn: Project is vulnerable to: GHSA-pc5p-h8pf-mvwp","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-29xr-v42j-r956","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-9m6j-fcg5-2442","Warn: Project is vulnerable to: GHSA-hh27-ffr2-f2jc","Warn: Project is vulnerable to: GHSA-rqff-837h-mm52","Warn: Project is vulnerable to: GHSA-8v38-pw62-9cw2","Warn: Project is vulnerable to: GHSA-hgjh-723h-mx2j","Warn: Project is vulnerable to: GHSA-jf5r-8hm2-f872","Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T05:47:42.612Z","repository_id":15237013,"created_at":"2025-08-24T05:47:42.613Z","updated_at":"2025-08-24T05:47:42.613Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30521384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-14T19:51:21.629Z","status":"ssl_error","status_checked_at":"2026-03-14T19:51:12.959Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["angular","json","react","spa","webpack-plugin"],"created_at":"2025-01-02T06:16:19.972Z","updated_at":"2026-03-14T23:31:44.411Z","avatar_url":"https://github.com/tettusud.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Merge json files\n\nMerge Json files using this webpack plugin.\n\nFor example,it will be useful to\nmerge i18n json files which are in different modules into a single\nfinal json files in angular2 or react modules.\n\n# Latest version and breaking changes.\n\n-   Breaking changes introduced in latest version 2.0.0, now all values will be overwritten including arrays, earlier behaviour\n    was to concatenate array and overrite literals.Going foward to concatenate either literals or arrays, pass **overwrite** false as an input, this will concatenate all values in target with source values.\n\n-   This version also fixes compatibility issue with **Webpack 5**\n\n## Usage\n\nInstall with npm\n\n```\nnpm i merge-jsons-webpack-plugin\n```\n\n```javascript\nvar MergeJsonWebpackPlugin = require(\"merge-jsons-webpack-plugin\");\nnew MergeJsonWebpackPlugin({\n    files: [\"./jsons/file1.json\", \"./jsons/file3.json\", \"./jsons/file2.json\"],\n    output: {\n        fileName: \"./dist/result.json\",\n    },\n});\n```\n\n## Details\n\nYou can specify either files or groupBy under output.\n\n**1) By files**  \n If you want to merge group of files use like this.\n\n```javascript\nnew MergeJsonWebpackPlugin({\n    debug: true,\n    files: [\"./jsons/file1.json\", \"./jsons/file3.json\", \"./jsons/file2.json\"],\n    output: {\n        fileName: \"./dist/result.json\",\n    },\n});\n```\n\n| Field Name      | Description                                                      |\n| --------------- | ---------------------------------------------------------------- |\n| files           | Array of json files to be merged                                 |\n| output.fileName | Name of merged output file ,relative path from output.path entry |\n\n**2) By Patterns**  \n This plugin uses glob for searching file patterns,please refer glob for usage for sample pattern. You can specify a pattern to pull all the files that satify the particular pattern and output a single json file.\n\n```javascript\nnew MergeJsonWebpackPlugin({\n    encoding: \"ascii\",\n    debug: true,\n    output: {\n        groupBy: [\n            {\n                pattern: \"{./jsons/module*/en.json,./jsons/file1.json}\",\n                fileName: \"./dist/en.json\",\n            },\n            {\n                pattern: \"{./jsons/module*/es.json,./jsons/file2.json}\",\n                fileName: \"./dist/es.json\",\n            },\n        ],\n    },\n    globOptions: {\n        nosort: true,\n    },\n});\n```\n\n| groupBy            | Array of patterns and corresponding fileNames.                                                                                |                                                                   |\n| ------------------ | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |\n| groupBy[].pattern  | Pattern to search files for. eg: \\*\\*/en.json will pull all en.json files under current working directory and sub directories |                                                                   |\n|                    | Do **not use** curly brackets if there is only single pattern to consider                                                     | pattern:\"./node_modules/\\*\\*/en.json\"                             |\n|                    | **Use** curly brackets to group more than one pattern together                                                                | pattern:\"{./node_modules/\\*\\*/en.json,./src/assets/i18n/en.json}\" |\n| groupBy[].fileName | output file name for the corresponding pattern.Relative path from output.path entry                                           |                                                                   |\n\n**3) Run time files**\n\nFiles generated at run time can also be specified as input to the pattern.The plugin will lookup in the compilation.assets of webpack and try to load it for processing.\n\n## Options\n\n| key            | Description.                                                                                                                                                                                                                                                                                                                                                                         |     |\n| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- |\n| debug          | if true, logs will be enabled, by default debug is false.                                                                                                                                                                                                                                                                                                                            |\n| encoding       | Optional, encoding to be used default is utf-8.                                                                                                                                                                                                                                                                                                                                      |     |\n| globOptions    | Optional, [glob options](https://github.com/isaacs/node-glob#options) to change pattern matching behavior.                                                                                                                                                                                                                                                                           |     |\n| prefixFileName | Optional. If true, file names will be prefixed to each file content and merged with outfile\u003cbr\u003e\u003cbr\u003eBy default, the generated prefix is ​​simply the filename without the .json extension. If you want to customize the process of generating prefixes, you can pass a function as this option. The function should take exactly one argument (the file path) and returns the prefix. |\n| space          | Optional. A `String` or `Number` object that's used to insert white space into the output JSON file for readability purposes. See [`space` parameter description on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Parameters) for details.                                                                                    |\n| ~~duplicates~~ | ~~**Default** value is false.If true, keys at same heirarchy will be preserved in an array, check [example](https://gist.github.com/alexxlagutin/68f89cae748282f19104f94a04196132#gistcomment-3039950).~~                                                                                                                                                                            |\n| overwrite      | Default true, if false values(for same keys) at same heirarchy will be preserved in an array. Check [example](https://gist.github.com/alexxlagutin/68f89cae748282f19104f94a04196132#gistcomment-3039950), [issue #31](https://github.com/tettusud/merge-jsons-webpack-plugin/issues/31), [issue #63](https://github.com/tettusud/merge-jsons-webpack-plugin/issues/63) .             |\n\n## Change Logs\n\n| Version     | Changes                                                                                                                                                                                                                                                                           |\n| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| 1.0.8       | Error handling improved. Now **fileName** is relative path to output path specified                                                                                                                                                                                               |\n| 1.0.10      | File watching feature added, result will be automatically refreshed if json files are modified                                                                                                                                                                                    |\n| 1.0.11      | Publish issues with previous version                                                                                                                                                                                                                                              |\n| 1.0.12      | Added glob options handling                                                                                                                                                                                                                                                       |\n| 1.0.13      | When using groupBy,fixed issue of compilation more than once, added capability to read dynamically generated files,and conditional logging                                                                                                                                        |\n| 1.0.14      | Webpack 4 breaking changes fix                                                                                                                                                                                                                                                    |\n| 1.0.15      | prefixFileName option added, for feature request #31                                                                                                                                                                                                                              |\n| 1.0.16      | Webpack 4 compatibile api changes                                                                                                                                                                                                                                                 |\n| 1.0.17      | Filex extension check removed,file can be of any extention as long as content is json.Testcases also added                                                                                                                                                                        |\n| 1.0.18      | Bom issue fix #22                                                                                                                                                                                                                                                                 |\n| 1.0.19      | Support for custom \"prefixFileName\" function                                                                                                                                                                                                                                      |\n| 1.0.20      | Output formatting via `space` parameter added, preserving duplicates in an array if `duplicates:true` instead of overriding existing value.                                                                                                                                       |\n| 2.0.0-alpha | **Breaking Changes** Webpack 5 compatibility update, removed **duplicates** option, instead added **overwrite** with default value true, this will break existing behaviour of concatination in case of an array, instead now by default overwrites array value in target object. |\n| 2.0.0       | Json processing moved to compilation hook **additionalAssets** and changed to sync to fix issue #68                                                                                                                                                                               |\n\n## Sample\n\nTo see sample you can navigate to example folder.\nFrom the root folder merge-jsons-webpack-plugin, you can start the sample application\nas mentioned below\n\n```\n\n   \u003e npm install\n   \u003e npm start\n\n```\n\nAccess the web application at\n\n```\n http://localhost:8080\n```\n\n## References\n\n-   https://www.npmjs.com/package/glob\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftettusud%2Fmerge-jsons-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftettusud%2Fmerge-jsons-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftettusud%2Fmerge-jsons-webpack-plugin/lists"}