1.0.0 • Published 8 years ago
quick-badge-generator v1.0.0
quick-badge-generator 
A simple API to generate badges for your GitHub Projects!
Install
$ npm install --save quick-badge-generatorUsage
'use strict';
const qbg = require('quick-badge-generator');
qbg('build', 'passing', 'green');
/*
{
default: 'https://img.shields.io/badge/build-passing-green.svg',
plastic: 'https://img.shields.io/badge/build-passing-green.svg?style=plastic',
flat: 'https://img.shields.io/badge/build-passing-green.svg?style=flat',
flatSquared: 'https://img.shields.io/badge/build-passing-green.svg?style=flat-square',
social: 'https://img.shields.io/badge/build-passing-green.svg?style=social'
}
*/
const prop = qbg('build', 'unkown', 'red');
console.log(prop.default);
// => https://img.shields.io/badge/build-failing-red.svgAPI
The default parameter for status and color are optional as they are replaced by unknown and lightgrey respectively when the value aren't provided!
qbg('subject', 'status', 'color')
subject
TYPE : string
status
TYPE : string
color
TYPE : string
You can only use the following colors in your badge :
brightgreegreenyellowgreenyelloworangeredlightgreyblue
STYLES
There are four styles available :
plasticflatflatSquaresocial
You can exract the required style using :
const styles = qbg('build', 'passing', 'green');
console.log(styles.plastic)
// => 'https://img.shields.io/badge/build-passing-green.svg?style=plastic'
console.log(styles.flat)
// => 'https://img.shields.io/badge/build-passing-green.svg?style=flat'
console.log(styles.flatSquare)
// => 'https://img.shields.io/badge/build-passing-green.svg?style=flat-square'
console.log(styles.social)
// => 'https://img.shields.io/badge/build-passing-green.svg?style=social'Related
Quick Badge Link:Generate links to pixel-perfect, retina-ready, fast, and consistent badges for your projects!
License
MIT © Rishi Giri
1.0.0
8 years ago