shieldman

2018-10-11 admin

shieldman是什么

什么是shieldman,Badges creator

shieldman使用教程帮助文档

shieldman

Badges creator

npm version Build Status Coverage Status

Installation

npm i -S shieldman

Usage

'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])

  • service is a String representing the service for which the shield will be created.
  • opts.style is the style of the shield. The available styles are: flat (the default one), flat-square and plastic.
  • opts.repo is the GitHub repo targeted by the shield. For the current repo the value would be KenanY/shields.
  • opts.branch is the branch name for which the shield is created.
  • opts.npmName is the npm name of the package for which the shield is created. This value is currently required only by the npm shield.

The shieldman function returns an Object obj which has three keys:

  • obj.image is a String link to the SVG of the shield for String service
  • obj.link is a String link to the project page of repo on the website of service
  • obj.text is a String label for the service

License

MIT © Zoltan Kochan

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-42388.html

文章标题:shieldman

回到顶部