{"id":23701148,"url":"https://github.com/ehanlin/gulp-json-injector","last_synced_at":"2026-01-29T10:30:15.820Z","repository":{"id":145358054,"uuid":"51061070","full_name":"eHanlin/gulp-json-injector","owner":"eHanlin","description":"The injector is able to modify json data. And you can add some base json data to be extended. You can implement a injector to modify json content, too.","archived":false,"fork":false,"pushed_at":"2016-04-28T02:03:25.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-30T09:32:36.017Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/eHanlin.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-04T08:00:10.000Z","updated_at":"2024-02-21T22:46:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"9ccb5145-5405-4f99-a557-3e4a63f1abfd","html_url":"https://github.com/eHanlin/gulp-json-injector","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eHanlin%2Fgulp-json-injector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eHanlin%2Fgulp-json-injector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eHanlin%2Fgulp-json-injector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eHanlin%2Fgulp-json-injector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eHanlin","download_url":"https://codeload.github.com/eHanlin/gulp-json-injector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239776618,"owners_count":19695143,"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":[],"created_at":"2024-12-30T09:32:18.231Z","updated_at":"2026-01-29T10:30:15.551Z","avatar_url":"https://github.com/eHanlin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"gulp-json-injector\n====================================\n\nThe injector is able to modify json data.\n\nAnd you can add some base json data to be extended.\n\nYou can implement a injector to modify json content, too.\n\n## Install\n\n```bash\nnpm install gulp-json-injector\n```\n\n## Usage\n\n```js\nvar gulp = require('gulp');\nvar jsonInjector = require('gulp-json-injector');\n\ngulp.task('default', function(){\n  gulp.src('config/**/*.json')\n    .pipe(jsonInjector({\n      bases:[{\n        path:'base.json',\n        mapping:/.*/\n      },\n      {\n        contents:{\n          tasks:['run']\n        }\n      }],\n      inject:function(json, next, file){\n        json.version = '0.0.2';\n        next(json);\n      }\n    }))\n    .pipe(gulp.dest('./dist/'))\n\n});\n```\n\n## Options\n\n#### inject: function\n\u003e Implement a **injector** to modified json data.\n\n#### bases: Object[]\n\u003e Add some target json data to be extended.\n\n**base.path:** A json file path will be read.\n\n**base.contents:** A json data base will be extended.\n\n**base.mapping:** Give a **regular expression** to validate file path. The default is all files.\n\nThe **base.path** or **base.contents** is only needed one.\n\n#### ignoreOtherFormat: boolean\n\u003e Ignore other formats for processing.\n\n## LICENSE\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 eHanlin Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehanlin%2Fgulp-json-injector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fehanlin%2Fgulp-json-injector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehanlin%2Fgulp-json-injector/lists"}