Jest coverage badges generator

Usage no npm install needed!

<script type="module">
  import adsoTsBadges from 'https://cdn.skypack.dev/@adso-ts/badges';


SVG badges generator for your repository

Module installs the following binary commands:

  • coverage-badges - Jest test coverage badges from coverage-summary.json (options: --read, --save)
  • custom-badges - Configurable badges from badges.json (options: --read, --save)
  • version-badge - Package version badge from package.json (options: --save)


yarn add @adso-ts/badges


For coverage-badges

Jest coverage report must be saved as coverage-summary.json, thus requires the following entries in jest.config.js are necessary:

module.exports = {
    collectCoverage: true,
    coverageReporters: ['json-summary'],

For custom-badges

A config file must be present and pointed to when executing custom-badges command.

  "badges": [
      "badge_name": {
        "label": "Badge label",
        "value": "value to show",
        "color": "hexadecimal color for value background"

Generate badges:

yarn script in package.json

"scripts": {
    "coverage-badges": "coverage-badges --read=custom_path_to_coverage-summary.json --save=custom_badges_folder"
    "custom-badges": "custom-badges --read=custom_path_to_badges.json --save=custom_badges_folder"
    "version-badge": "version-badge --save=custom_badges_folder"

Console commands

  yarn coverage-badges
  yarn custom-badges
  yarn version-badge

Parameters (optional)

  • read : alternative location of JSON file (coverage-summary.json or badges.json)
  • save : custom path to save badge svg files

Usage in markdown files

Jest test coverage


Package version


Custom/static badges examples



Test coverage


Lines Statements Branches Functions



Custom/static badges examples

npm dependencies