lcov-badge-generator

Generate a badge from a lcov report


Keywords
lcov, badge, coverage, test, code coverage, istanbul, istanbul nyc, jest
License
MIT
Install
npm install lcov-badge-generator@1.0.5

Documentation

lcov badge generator

Most solutions use a 3rd party service to implement badges on their github page. This solutions generates the badge locally.

This does not utilize shields.io, and does not write to the readme file, however you only need to update the readme once since the file is generated locally, it will always reference the generated file.

Usage

Required

Path to report

lcov-badge-generator ./lcov.info

Optional

Output path

lcov-badge-generator -o ./coverage/badge-name.svg

defaults to ./badge.svg

Label

lcov-badge-generator -l code coverage

defaults to coverage

npm script

"coverage": "lcov-badge-generator -o ./badges/coverage.svg ./coverage/lcov.info

Yet to come

  • Configure percentage thresholds