A package to easily generate badges for your Git repositories (like the ones above).
npm install --save-dev @dannyxcii/badger
To get started generating badges, add the required comment to the desired location in your projects README file. The necessary comment for each badge is listed below.
<!-- JS Coverage Badge -->
npx badger --jest ./path/to/coverage-final.json
Accepts a valid package.json
or composer.json
filepath.
<!-- Version Badge -->
npx badger --version ./path/to/json
Accepts a valid package.json
or composer.json
filepath.
<!-- License Badge -->
npx badger --license ./path/to/json
<!-- PHP Coverage Badge -->
<img src="https://img.shields.io/badge/PHP Coverage-7.04%25-red" alt="PHP Coverage 7.04%">
npx badger --phpunit ./path/to/coverage.xml
By default, Badger attempts to update ./README.md
- if your README file is located somewhere else you can pass the
--readme
flag along with any other flags:
npx badger --jest ./path/to/coverage --readme ./path/to/readme