{"id":39647768,"url":"https://github.com/joshswan/gulp-merge-json","last_synced_at":"2026-01-18T09:07:17.039Z","repository":{"id":1611225,"uuid":"43193038","full_name":"joshswan/gulp-merge-json","owner":"joshswan","description":"A gulp plugin to merge JSON \u0026 JSON5 files into one file","archived":false,"fork":false,"pushed_at":"2024-02-29T21:10:02.000Z","size":740,"stargazers_count":36,"open_issues_count":2,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-29T11:44:57.737Z","etag":null,"topics":["gulp","gulp-plugin","json","json-merger","json5"],"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/joshswan.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}},"created_at":"2015-09-26T05:12:50.000Z","updated_at":"2024-02-26T22:53:38.000Z","dependencies_parsed_at":"2024-02-29T22:28:17.218Z","dependency_job_id":"8b6f5fda-1d45-4e80-a60c-89fbad6b17d3","html_url":"https://github.com/joshswan/gulp-merge-json","commit_stats":{"total_commits":90,"total_committers":13,"mean_commits":6.923076923076923,"dds":0.6,"last_synced_commit":"6e1f7c9eb7d2c804d8555f92d2ddfc651077f754"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/joshswan/gulp-merge-json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshswan%2Fgulp-merge-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshswan%2Fgulp-merge-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshswan%2Fgulp-merge-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshswan%2Fgulp-merge-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshswan","download_url":"https://codeload.github.com/joshswan/gulp-merge-json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshswan%2Fgulp-merge-json/sbom","scorecard":{"id":534308,"data":{"date":"2025-08-11","repo":{"name":"github.com/joshswan/gulp-merge-json","commit":"53d6a4161b13eb50e948c66c49005cc2fa1814a2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"name":"Code-Review","score":1,"reason":"Found 4/30 approved changesets -- score normalized to 1","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":"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":"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":"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":"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":"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":"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:0","Info: FSF or OSI recognized license: MIT License: LICENSE: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 4 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":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3"],"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-20T06:33:07.074Z","repository_id":1611225,"created_at":"2025-08-20T06:33:07.074Z","updated_at":"2025-08-20T06:33:07.074Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["gulp","gulp-plugin","json","json-merger","json5"],"created_at":"2026-01-18T09:07:16.946Z","updated_at":"2026-01-18T09:07:17.010Z","avatar_url":"https://github.com/joshswan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gulp-merge-json\n\n[![Version][version-image]][package-url] [![Downloads][downloads-image]][package-url] [![Build Status][build-image]][build-url] [![Coverage][coverage-image]][coverage-url] [![License][license-image]][license-url]\n\nA gulp plugin for deep-merging multiple JSON files into one file. Export as JSON or a node module.\n\n## Usage\n\n```javascript\ngulp.src('jsonFiles/**/*.json')\n\t.pipe(merge(options))\n\t.pipe(gulp.dest('./dist'));\n```\n\n### Options\n\n| Key | Type | Default | Description |\n| ---- | ---- | ------- | ----------- |\n| `fileName` | `String` | `combined.json` | Output filename |\n| `edit` | `Function` | `json =\u003e json` | Edit function (add/remove/edit keys during merge) |\n| `transform` | `Function` | `json =\u003e json` | Transform final merged object (similar to edit but applied at the end) |\n| `startObj` | `Object/Array` | `{}` | Starting object to merge into (useful for providing default values) |\n| `endObj` | `Object/Array` | | Object to merge after file merging complete (useful for overwriting with special values) |\n| `exportModule` | `Boolean/String` | `false` | Output `module.exports = {MERGED_JSON_DATA};` or `{exportModule} = {MERGED_JSON_DATA}` when string passed |\n| `concatArrays` | `Boolean` | `false` | Whether to concatenate arrays instead of merging |\n| `mergeArrays` | `Boolean` | `true` | Whether to merge arrays or overwrite completely |\n| `customizer` | `Function` | | Custom merge function for use with [`mergeWith`](https://lodash.com/docs/#mergeWith) |\n| `jsonReplacer` | `Function` | | Custom JSON replacer function passed to stringify |\n| `jsonSpace` | `String` | `\\t` | String used for white space by stringify |\n| `json5` | `Boolean` | `false` | Use JSON5 instead of JSON for parse and stringify |\n\n## Examples\n```javascript\nvar merge = require('gulp-merge-json');\n\n/**\n * Basic functionality\n */\ngulp.src('jsonFiles/**/*.json')\n\t.pipe(merge())\n\t.pipe(gulp.dest('./dist'));\n\n/**\n * Edit JSON with function\n */\ngulp.src('jsonFiles/**/*.json')\n\t.pipe(merge({\n\t\tfileName: 'file.json',\n\t\tedit: (parsedJson, file) =\u003e {\n\t\t\tif (parsedJson.someValue) {\n\t\t\t\tdelete parsedJson.otherValue;\n\t\t\t}\n\n\t\t\treturn parsedJson;\n\t\t},\n\t}))\n\t.pipe(gulp.dest('./dist'));\n\n/**\n * Edit final JSON with transformer function\n */\ngulp.src('jsonFiles/**/*.json')\n\t.pipe(merge({\n\t\tfileName: 'file.json',\n\t\ttransform: (mergedJson) =\u003e {\n\t\t\treturn {\n\t\t\t\tkey: {\n\t\t\t\t\ttype: 'data',\n\t\t\t\t\t...mergedJson,\n\t\t\t\t};\n\t\t\t};\n\t\t},\n\t}))\n\t.pipe(gulp.dest('./dist'));\n\n/**\n * Provide a default object (files are merged in order so object values will be overwritten)\n */\ngulp.src('jsonFiles/**/*.json')\n\t.pipe(merge({\n\t\tstartObj: { someKey: 'defaultValue' },\n\t}))\n\t.pipe(gulp.dest('./dist'));\n\n/**\n * Provide an overwriting object (merged at the end)\n */\ngulp.src('jsonFiles/**/*.json')\n\t.pipe(merge({\n\t\tendObj: { someKey: 'specialValue' },\n\t}))\n\t.pipe(gulp.dest('./dist'));\n\n/**\n * Output module.exports = {JSON_DATA}\n */\ngulp.src('jsonFiles/**/*.json')\n\t.pipe(merge({\n\t\texportModule: true,\n\t}))\n\t.pipe(gulp.dest('./dist'));\n\n/**\n * Output a custom variable = {JSON_DATA}\n */\ngulp.src('jsonFiles/**/*.json')\n\t.pipe(merge({\n\t\tfileName: 'dataModule.js',\n\t\texportModule: 'const myVar',\n\t}))\n\t.pipe(gulp.dest('./dist'));\n\n/**\n * Provide replacer and space options for JSON.stringify\n */\ngulp.src('jsonFiles/**/*.json')\n    .pipe(merge({\n        jsonSpace: '  ',\n        jsonReplacer: (key, value) =\u003e {/*...*/}\n    })\n    .pipe(gulp.dest('./dist'));\n\n/**\n * Use a customizer function for custom merging behavior\n */\ngulp.src('jsonFiles/**/*.json')\n  .pipe(merge({\n    customizer: (objA, objB) =\u003e {\n      // Example: Concat arrays but only keep unique values\n      if (Array.isArray(objA) \u0026\u0026 Array.isArray(objB)) {\n        return objA.concat(objB).filter((item, index, array) =\u003e (\n          array.indexOf(item) === index\n        ));\n      }\n\n      return undefined;\n    },\n  }))\n  .pipe(gulp.dest('./dist'));\n\n/**\n * JSON5\n */\ngulp.src('jsonFiles/**/*.json5')\n\t.pipe(merge({\n\t\tjson5: true,\n\t}))\n\t.pipe(gulp.dest('./dist'));\n```\n\n\n### Example Input\n```JSON\n/*\n\tjson/defaults.json\n */\n{\n\t\"key1\": {\n\t\t\"data1\": \"value1\",\n\t\t\"data2\": \"value2\"\n\t},\n\t\"key2\": {\n\t\t\"dataA\": \"valueA\",\n\t\t\"dataB\": {\n\t\t\t\"a\": \"b\",\n\t\t\t\"c\": \"d\"\n\t\t}\n\t}\n}\n\n/*\n\tjson/development.json\n */\n{\n\t\"key1\": {\n\t\t\"data1\": \"devValue\"\n\t},\n\t\"key2\": {\n\t\t\"dataB\": {\n\t\t\t\"c\": \"DEV MODE!\"\n\t\t}\n\t},\n\t\"key3\": {\n\t\t\"important\": \"value\"\n\t}\n}\n```\n\n### Example Output\n```JSON\n/*\n\tdist/combined.json\n */\n{\n\t\"key1\": {\n\t\t\"data1\": \"devValue\",\n\t\t\"data2\": \"value2\"\n\t},\n\t\"key2\": {\n\t\t\"dataA\": \"valueA\",\n\t\t\"dataB\": {\n\t\t\t\"dataA\": \"valueA\",\n\t\t\t\"dataB\": {\n\t\t\t\t\"a\": \"b\",\n\t\t\t\t\"c\": \"DEV MODE!\"\n\t\t\t}\n\t\t}\n\t},\n\t\"key3\": {\n\t\t\"important\": \"value\"\n\t}\n}\n```\n\n[build-image]: https://img.shields.io/circleci/build/github/joshswan/gulp-merge-json?style=flat-square\n[build-url]: https://circleci.com/gh/joshswan/gulp-merge-json\n[coverage-image]: https://img.shields.io/coveralls/github/joshswan/gulp-merge-json?style=flat-square\n[coverage-url]: https://coveralls.io/github/joshswan/gulp-merge-json\n[downloads-image]: https://img.shields.io/npm/dm/gulp-merge-json?style=flat-square\n[license-image]: https://img.shields.io/npm/l/gulp-merge-json?color=blue\u0026style=flat-square\n[license-url]: https://github.com/joshswan/gulp-merge-json/blob/master/LICENSE\n[package-url]: https://www.npmjs.com/package/gulp-merge-json\n[version-image]: https://img.shields.io/npm/v/gulp-merge-json?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshswan%2Fgulp-merge-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshswan%2Fgulp-merge-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshswan%2Fgulp-merge-json/lists"}