{"id":15677999,"url":"https://github.com/jaywcjlove/coverage-badges-cli","last_synced_at":"2025-10-16T09:25:25.774Z","repository":{"id":37024654,"uuid":"408232674","full_name":"jaywcjlove/coverage-badges-cli","owner":"jaywcjlove","description":"Create coverage badges from coverage reports (no 3rd parties servers).","archived":false,"fork":false,"pushed_at":"2024-10-04T12:06:53.000Z","size":1241,"stargazers_count":16,"open_issues_count":2,"forks_count":17,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-29T11:27:24.710Z","etag":null,"topics":["badges","cli","cli-app","coverage","coverage-badges","coverage-badges-cli","nodejs","typescript"],"latest_commit_sha":null,"homepage":"https://jaywcjlove.github.io/coverage-badges-cli/","language":"TypeScript","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/jaywcjlove.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"jaywcjlove","buy_me_a_coffee":"jaywcjlove","custom":["https://www.paypal.me/kennyiseeyou","https://jaywcjlove.github.io/#/sponsor"]}},"created_at":"2021-09-19T20:44:06.000Z","updated_at":"2024-10-07T09:10:04.000Z","dependencies_parsed_at":"2023-01-23T16:45:42.045Z","dependency_job_id":"5aa9c5ca-d806-40ed-9b13-bc388b096095","html_url":"https://github.com/jaywcjlove/coverage-badges-cli","commit_stats":{"total_commits":121,"total_committers":6,"mean_commits":"20.166666666666668","dds":"0.18181818181818177","last_synced_commit":"7f61b1e9349158781864dec1a5368a9c95133a30"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fcoverage-badges-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fcoverage-badges-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fcoverage-badges-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaywcjlove%2Fcoverage-badges-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaywcjlove","download_url":"https://codeload.github.com/jaywcjlove/coverage-badges-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247856944,"owners_count":21007679,"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":["badges","cli","cli-app","coverage","coverage-badges","coverage-badges-cli","nodejs","typescript"],"created_at":"2024-10-03T16:14:47.980Z","updated_at":"2025-10-16T09:25:25.768Z","avatar_url":"https://github.com/jaywcjlove.png","language":"TypeScript","funding_links":["https://ko-fi.com/jaywcjlove","https://buymeacoffee.com/jaywcjlove","https://www.paypal.me/kennyiseeyou","https://jaywcjlove.github.io/#/sponsor"],"categories":[],"sub_categories":[],"readme":"coverage-badges-cli\n===\n\u003c!--rehype:style=display: flex; height: 230px; align-items: center; justify-content: center; font-size: 38px;--\u003e\n\n[![Buy me a coffee](https://img.shields.io/badge/Buy%20me%20a%20coffee-048754?logo=buymeacoffee)](https://jaywcjlove.github.io/#/sponsor)\n[![Build \u0026 Deploy](https://github.com/jaywcjlove/coverage-badges-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/jaywcjlove/coverage-badges-cli/actions/workflows/ci.yml)\n[![Coverage Status](https://jaywcjlove.github.io/coverage-badges-cli/badges.svg)](https://jaywcjlove.github.io/coverage-badges-cli/lcov-report/)\n[![npm version](https://img.shields.io/npm/v/coverage-badges-cli.svg)](https://www.npmjs.com/package/coverage-badges-cli)\n[![Download NPM](https://img.shields.io/npm/dm/coverage-badges-cli.svg?style=flat)](https://www.npmjs.com/package/coverage-badges-cli/)\n\nCreate coverage badges from coverage reports. Using GitHub Actions and GitHub Workflow CPU time (no 3rd parties servers).\n\nDon't worry about the [coverage.io](https://coveralls.io/) service is down.\n\n## Install\n\n```shell\n$ npm i coverage-badges-cli\n```\n\n## Example\n\n```js\n{\n  \"scripts\": {\n    \"coverage\": \"jest --coverage\"\n    \"make-badges\": \"coverage-badges\",\n  },\n  \"jest\": {\n    \"collectCoverageFrom\": [\n      \"\u003crootDir\u003e/packages/**/*.{tsx,ts}\",\n      \"!**/*.{js,d.ts}\"\n    ],\n    \"coverageReporters\": [\n      \"lcov\",\n      \"json-summary\"\n    ],\n  }\n}\n```\n\nThis config creates a coverage badge in a default directory ./badges.\n\nYou can add `![Coverage](./coverage/badges.svg)` to your README.md after the badge creation.\n\n## Github Actions\n\n### Input Parameters\n\n![](https://jaywcjlove.github.io/coverage-badges-cli/badges-classic.svg)\n![](https://jaywcjlove.github.io/coverage-badges-cli/badges-flat.svg)\n\n- `source` - The path of the target file \"coverage-summary.json\".\n- `output` - Output image path.\n- `label` - The left label of the badge, usually static (default `coverage`).\n- `labelColor` - \\\u003cColor RGB\u003e or \\\u003cColor Name\u003e (default: `555`).\n- `color` - \\\u003cColor RGB\u003e or \\\u003cColor Name\u003e (default: '')\n- `scale` - Set badge scale (default: `1`).\n- `style` - Badges style: `flat`, `classic` (default `classic`).\n- ~~`type`~~ - (No longer supported after v1.2.0) Coverage report type: `lines`, `statements`, `functions`, `branches` (default `statements`)\n- `jsonPath` - Path to the coverage percentage number to be used in the badge (default `total.statements.pct`)\n- `arbitrary` - Allow `jsonPath` to point to non-number values. Works in conjunction with `jsonPath`\n- `icon` - Path to icon file\n\n```yml\n- name: Create Coverage Badges\n  uses: jaywcjlove/coverage-badges-cli@main\n  with:\n    style: flat\n    source: coverage/coverage-summary.json\n    output: coverage/badges.svg\n    jsonPath: totals.percent_covered\n\n- name: Deploy\n  uses: peaceiris/actions-gh-pages@v3\n  with:\n    github_token: ${{ secrets.GITHUB_TOKEN }}\n    publish_dir: ./build\n```\n\n### Output Parameters\n\nsvg svg image string: `\u003csvg xmlns....`.\n\n### Using the command line\n\n```yml\nname: Build \u0026 Deploy\non:\n  push:\n    branches:\n      - master\n\njobs:\n  build-deploy:\n    runs-on: ubuntu-18.04\n    steps:\n    - uses: actions/checkout@v2\n    - uses: actions/setup-node@v2\n      with:\n        node-version: 14\n\n    - run: npm install\n    - run: npm run build\n    - run: npm run coverage\n    - run: npm i coverage-badges-cli -g\n    - run: coverage-badges --output coverage/badges.svg\n\n    - name: Deploy\n      uses: peaceiris/actions-gh-pages@v3\n      if: github.ref == 'refs/heads/master'\n      with:\n        github_token: ${{ secrets.GITHUB_TOKEN }}\n        publish_dir: ./coverage\n```\n\n## Command Help\n\n```bash\nUsage: coverage-badges [options] [--help|h]\n\nOptions:\n\n  --version, -v  Show version number\n  --help, -h     Displays help information.\n  --output, -o   Output directory.\n  --source, -s   The path of the target file \"coverage-summary.json\".\n  --style        Badges style: flat, flat-square.\n  --type         Coverage type: lines, statements, functions, branches.\n  --scale        Set badge scale (default: 1)\n  --icon         Path to icon file\n  --iconWidth    Set this if icon is not square (default: 13)\n  --label        The left label of the badge, usually static (default `coverage`).\n  --labelColor   \u003cColor RGB\u003e or \u003cColor Name\u003e (default: '555')\n  --color        \u003cColor RGB\u003e or \u003cColor Name\u003e (default: '')\n  --jsonPath     Path to the coverage percentage number to be used in the badge.\n  --arbitrary    Allow jsonPath to point to non-number values. Works in conjunction with jsonPath.\n\nExample:\n\n  npm coverage-badges-cli --output coverage/badges.svg\n  npm coverage-badges-cli --style plastic\n  npm coverage-badges-cli --source coverage/coverage-summary.json\n  npm coverage-badges-cli --labelColor ADF\n```\n\n## Development\n\n```bash\n$ npm i\n$ npm run build\n$ npm run watch\n```\n\n## See also\n\n- [Github Release Changelog](https://github.com/jaywcjlove/changelog-generator) Generator A GitHub Action that compares the commit differences between two branches\n- [Create Tags From](https://github.com/jaywcjlove/create-tag-action) Auto create tags from commit or package.json.\n- [Github Action Contributors](https://github.com/jaywcjlove/github-action-contributors) Github action generates dynamic image URL for contributor list to display it!\n- [Create Coverage Badges](https://github.com/jaywcjlove/coverage-badges-cli) Create coverage badges from coverage reports. (no 3rd parties servers)\n- [Generated Badges](https://github.com/jaywcjlove/generated-badges) Create a badge using GitHub Actions and GitHub Workflow CPU time (no 3rd parties servers)\n\n## Contributors\n\nAs always, thanks to our amazing contributors!\n\n\u003ca href=\"https://github.com/jaywcjlove/coverage-badges-cli/graphs/contributors\"\u003e\n  \u003cimg src=\"https://jaywcjlove.github.io/coverage-badges-cli/CONTRIBUTORS.svg\" /\u003e\n\u003c/a\u003e\n\nMade with [contributors](https://github.com/jaywcjlove/github-action-contributors).\n\n## License\n\nMIT © [Kenny Wong](https://wangchujiang.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaywcjlove%2Fcoverage-badges-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaywcjlove%2Fcoverage-badges-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaywcjlove%2Fcoverage-badges-cli/lists"}