1.0.0 • Published 8 years ago
shields-badges-urls v1.0.0
shields-badges-urls
API
shieldsBadgesUrls(serviceName, serviceParams, options?) => URLs
serviceNameandserviceParamsoptions?format?:'svg','png','json', etc.urlParams?
URLs: has two properties,imageandlink. Both are WHATWG URL objects. Thepackage.jsonbrowserfield is used so that in Node.js the URLs are instances ofURLand in a browser build they are instances ofURL.image: The URL for the shields.io badge imagelink: This is service specific. See the example, below.
Example
import shieldsBadgesUrls from 'shields-badges-urls'
const { image, link } = shieldsBadgesUrls('travis', { userRepo: 'foo/bar' })
image.href
// 'https://img.shields.io/travis/foo/bar.svg'
link.href
// 'https://travis-ci.org/foo/bar'1.0.0
8 years ago