1.3.3 • Published 5 years ago

cb-badges v1.3.3

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

The definitive collection of badges for rendering

npm

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)

These amazing people are maintaining this project:

These amazing people have contributed code to this project: