Skip to content

A package for generating badges in your projects README file.

Notifications You must be signed in to change notification settings

DanielWinning/badger

Repository files navigation

Badger | JS Badge Generation Package

Version 0.5.0 JS Coverage 90.45% License GPL--3.0--only

A package to easily generate badges for your Git repositories (like the ones above).

Installation

npm install --save-dev @dannyxcii/badger

Usage

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.

Badges

Jest Coverage

<!-- JS Coverage Badge -->
npx badger --jest ./path/to/coverage-final.json

Version

Accepts a valid package.json or composer.json filepath.

<!-- Version Badge -->
npx badger --version ./path/to/json

License

Accepts a valid package.json or composer.json filepath.

<!-- License Badge -->
npx badger --license ./path/to/json

PHPUnit Coverage

<!-- 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

Additional Options

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