1.4.1 • Published 5 years ago
shieldman v1.4.1
shieldman
Badges creator
Installation
npm i -S shieldmanUsage
'use strict'
const shieldman = require('shieldman')
const shield = shieldman('travis', { repo: 'zkochan/shieldman' })
console.log(shield)
//> { text: 'Build Status',
// link: 'https://travis-ci.org/zkochan/shieldman',
// image: 'https://img.shields.io/travis/zkochan/shieldman.svg' }API
shieldman(service, [opts])
serviceis a String representing the service for which the shield will be created.opts.styleis the style of the shield. The available styles are: flat (the default one), flat-square and plastic.opts.repois the GitHub repo targeted by the shield. For the current repo the value would beKenanY/shields.opts.branchis the branch name for which the shield is created.opts.npmNameis the npm name of the package for which the shield is created. This value is currently required only by thenpmshield.
The shieldman function returns an Object obj which has three keys:
obj.imageis a String link to the SVG of the shield for Stringserviceobj.linkis a String link to the project page ofrepoon the website ofserviceobj.textis a String label for theservice