shields-badge-data
v4.0.1
Published
Get Shields.io badges data.
Downloads
2
Maintainers
Readme
shields-badge-data
Gets Shields.io badge data.
API
shieldsBadgeData(badgeName, badgeArgs, options?) => BadgeData
badgeName
is one of these. For example,'travisCi'
.badgeArgs
: A set of arguments for the specific badge. See badge specs.options
?BadgeData
:
URLs
URLs are WHATWG URL objects. The package.json
browser
field is used so that:
- In Node.js the they are instances of the Node.js implementation.
- In a browser build they are instances of the browser implementation.
Example
import shieldsBadgeData from 'shields-badge-data'
const { title, image, link } = shieldsBadgeData('travisCi', { userRepo: 'foo/bar' })
title
// 'Travis CI build status badge for `foo/bar`'
image.href
// 'https://img.shields.io/travis/foo/bar.svg'
link.href
// 'https://travis-ci.org/foo/bar'