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

gh-badges

Package Overview
Dependencies
Maintainers
3
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.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
116
decreased by-50.21%
Maintainers
3
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'],
  colorscheme: 'green',
  template: 'flat',
}

const svg = bf.create(format)

Format

The format is the following:

{
  text: [ 'build', 'passed' ],  // Textual information shown, in order

  format: 'svg',  // Also supports json

  colorscheme: 'green',
  // or ...
  colorA: '#555',
  colorB: '#4c1',

  // See templates/ for a list of available templates.
  // Each offers a different visual design.
  template: 'flat',
}

See also

Defaults

If you want to use a colorscheme, head to lib/colorscheme.json. Each scheme has a name and a CSS/SVG color for the color used in the first box (for the first piece of text, field colorA) and for the one used in the second box (field colorB).

"green": {
  "colorB": "#4c1"
}

Both colorA and colorB have default values. Usually, the first box uses the same dark grey, so you can rely on that default value by not providing a "colorA" field (such as above).

You can also use the "colorA" and "colorB" fields directly in the badges if you don't want to make a color scheme for it. In that case, remove the "colorscheme" field altogether.

Keywords

FAQs

Package last updated on 18 Nov 2018

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