Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gh-badges

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gh-badges

Shields.io badge library

  • 2.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
116
decreased by-50.21%
Maintainers
4
Weekly downloads
 
Created
Source

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

  • templates/ for the template option

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.

Keywords

FAQs

Package last updated on 29 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc