cb-badges

The definitive collection of badges for rendering

badges

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
Patreon donate button Flattr donate button Liberapay donate button Thanks App donate button Boost Lab donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

The definitive collection of badges for rendering

Install

npm

  • Install: npm install --save cb-badges
  • Require: require('cb-badges')

jspm

<script type="module">
    import * as pkg from '//dev.jspm.io/cb-badges'
</script> 

This project provides its type information via inline JSDoc Comments. To make use of this in TypeScript, set your maxNodeModuleJsDepth compiler option to 5 or thereabouts. You can accomlish this via your tsconfig.json file like so:

{
  "compilerOptions": {
    "maxNodeModuleJsDepth": 5
  }
}

Usage

// Listing of badges to output
const list = [
  // Custom Badges
  ['badge', {image: 'image', alt: 'alt'}],
  ['badge', {image: 'image', alt: 'alt', url: 'url', title: 'title'}],
  ['shields', {left: 'left', right: 'right', alt: 'alt', url: 'url', title: 'title'}],
  ['shields', {left: 'left', right: 'right', color: 'red', alt: 'alt', url: 'url', title: 'title'}]
]
 
// Configuration for the badges
const config = {
}
 
// Options for rendering the badges
const options = {
    // Filter Category
    // When set to a string, will only render badges from the list that of the specified category
    // Values can be 'development', 'testing', 'funding', or 'social'
    // E.g. to render only funding badges, set to 'funding'
    filterCategory: false,
 
    // Filter Scripts
    // When true, do not render any badges from the list that are scripts
    filterScripts: false
}
 
// Render the badges to a string
const result = require('cb-badges').renderBadges(list, config, options)
 
// Output the result
console.log(result)

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

Contributors

These amazing people have contributed code to this project:

License