Files
shields/gh-badges/README.md
chris48s 6fe566de41 Run package tests on multiple node versions with nvm (#3498)
* run package tests on multiple node versions with nvm

* Add release schedule to package readme
2019-05-29 15:55:27 +01:00

3.4 KiB
Raw Blame History

gh-badges

npm version npm license

Installation

npm install gh-badges

Usage

On the console

npm install -g gh-badges
badge build passed :green .png > mybadge.png

As a library

const { BadgeFactory } = require('gh-badges')

const bf = new BadgeFactory()

const format = {
  text: ['build', 'passed'],
  color: 'green',
  template: 'flat',
}

const svg = bf.create(format)

Node version support

The latest version of gh-badges supports all currently maintained Node versions. See the Node Release Schedule.

Format

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`.
}

See also

Colors

There are three ways to specify color and labelColor:

  1. One of the Shields named colors:
  • the default labelColor

  • the default color

  • the default color

  1. A three- or six-character hex color, optionally prefixed with #:
  • etc.
  1. Any valid CSS color, e.g.
  • rgb(...), rgba(...)
  • hsl(...), hsla(...)
  • etc.