{"id":18566149,"url":"https://github.com/daniel-hayes/generate-json-file-webpack-plugin","last_synced_at":"2026-04-20T10:32:23.346Z","repository":{"id":57246126,"uuid":"123610279","full_name":"daniel-hayes/generate-json-file-webpack-plugin","owner":"daniel-hayes","description":"Webpack plugin that creates a custom JSON file.","archived":false,"fork":false,"pushed_at":"2018-03-03T00:50:45.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-20T21:54:15.232Z","etag":null,"topics":["generate","json","webpack","webpack-plugin","webpack4"],"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/daniel-hayes.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}},"created_at":"2018-03-02T17:36:34.000Z","updated_at":"2023-03-08T23:47:26.000Z","dependencies_parsed_at":"2022-08-24T16:31:34.176Z","dependency_job_id":null,"html_url":"https://github.com/daniel-hayes/generate-json-file-webpack-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/daniel-hayes/generate-json-file-webpack-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-hayes%2Fgenerate-json-file-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-hayes%2Fgenerate-json-file-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-hayes%2Fgenerate-json-file-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-hayes%2Fgenerate-json-file-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daniel-hayes","download_url":"https://codeload.github.com/daniel-hayes/generate-json-file-webpack-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-hayes%2Fgenerate-json-file-webpack-plugin/sbom","scorecard":{"id":319214,"data":{"date":"2025-08-11","repo":{"name":"github.com/daniel-hayes/generate-json-file-webpack-plugin","commit":"9726df61c5194610318a4ea617da468a13eb6993"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/5 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":"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":"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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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 3 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"}}]},"last_synced_at":"2025-08-18T00:58:13.720Z","repository_id":57246126,"created_at":"2025-08-18T00:58:13.720Z","updated_at":"2025-08-18T00:58:13.720Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32043017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"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":["generate","json","webpack","webpack-plugin","webpack4"],"created_at":"2024-11-06T22:22:00.801Z","updated_at":"2026-04-20T10:32:23.326Z","avatar_url":"https://github.com/daniel-hayes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# generate-json-file-webpack-plugin\n\nWebpack plugin that creates a custom JSON file.\n\n\n## Install\n\n```bash\nnpm install --save-dev generate-json-file-webpack-plugin\n```\n\n## Options\n\n|Name|Type|Description|\n|:--:|:--:|:----------|\n|[`filename`](#filename)|`{String}`|Output file name|\n|[`jsonFile`](#jsonFile)|`{String}`|Path to an existing JSON file to extend (optional)|\n|[`value`](#value)|`{Object\\|Function}`|Object to add to output file. (You don't actually need to return anything if you are extending an existing file. You can just manipulate the properties.)|\n\n## Usage\n\nIn your `webpack.config.js` instantiate the plugin.\n\n```javascript\nconst GenerateJsonFile = require('generate-json-file-webpack-plugin');\n\nmodule.exports = {\n  // webpack configuration\n  // ...\n  plugins: [\n    new GenerateJsonFile({\n      // json configuration\n    })\n  ]\n};\n```\n\nHere is a basic example that creates a `mainfest.json` file in your output directory:\n\n**webpack.config.js**\n```javascript\nmodule.exports = {\n  output: {\n    path: 'dist/'\n  },\n  // ...\n  plugins: [\n    new GenerateJsonFile({\n      filename: 'manifest.json',\n      value: {\n        foo: 'bar'\n      }\n    })\n  ]\n};\n\n```\nThat will generate a file that looks like this:\n\n**manifest.json**\n```json\n{\n  \"foo\": \"bar\"\n}\n```\n\n\nHere's an example of how you can dynamically configure values to be emitted to your JSON file:\n\n**webpack.config.js**\n```javascript\nplugins: [\n  new GenerateJsonFile({\n    filename: 'manifest.json',\n    value: () =\u003e {\n      if (mode === 'development') {\n        return {\n          foo: 'bar'\n        }\n      }\n\n      return {\n        foo: 'baz'\n      }\n    }\n  })\n]\n```\n\nYou can add to existing JSON files by using the `jsonFile` option and including a path to your source file:\n\n**webpack.config.js**\n```javascript\nplugins: [\n  new GenerateJsonFile({\n    jsonFile: './src/manifest.json',\n    filename: 'manifest.json',\n    value: (manifest) =\u003e {\n\n      // manipulate existing values\n      manifest.array.push('add me!');\n\n      // add new values\n      return {\n        foo: 'baz'\n      }\n    }\n  })\n]\n```\nHere is the source file that you are extending:\n\n**manifest.json** \n```json\n{\n  \"array\": [\"bar\"]\n}\n```\n\nAnd the output file:\n\n**manifest.json**\n```json\n{\n  \"array\": [\"bar\", \"add me!\"],\n  \"foo\": \"baz\"\n}\n```\n\n### Todo:\n- add tests\n\n## License\n\nMIT © [Daniel Hayes](https://github.com/daniel-hayes)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-hayes%2Fgenerate-json-file-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniel-hayes%2Fgenerate-json-file-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-hayes%2Fgenerate-json-file-webpack-plugin/lists"}