npm install gh-badges
npm install -g gh-badges
badge build passed :green .png > mybadge.png
const { BadgeFactory } = require('gh-badges')
const bf = new BadgeFactory()
const format = {
text: ['build', 'passed'],
color: 'green',
template: 'flat',
}
const svg = bf.create(format)
The latest version of gh-badges supports all currently maintained Node versions. See the Node Release Schedule.
The format is the following:
{
text: [ 'build', 'passed' ], // Textual information shown, in order
format: 'svg', // Also supports json
color: '#4c1',
labelColor: '#555',
// See templates/ for a list of available templates.
// Each offers a different visual design.
template: 'flat',
// Deprecated attributes:
colorscheme: 'green', // Now an alias for `color`.
colorB: '#4c1', // Now an alias for `color`.
colorA: '#555', // Now an alias for `labelColor`.
}
- templates/ for the
template
option
There are three ways to specify color
and labelColor
:
- One of the Shields named colors:
- A three- or six-character hex color, optionally prefixed with
#
:
- Any valid CSS color, e.g.