Generate shields for your current project's README
npm install shields[![Build Status][travis-svg]][travis]
[![Dependency Status][gemnasium-svg]][gemnasium]
Generate shields for your current project's README.md.
From the command-line:
`` bash
$ shields travis gemnasium
[![Build Status][travis-svg]][travis]
[![Dependency Status][gemnasium-svg]][gemnasium]
[travis]: https://travis-ci.org/KenanY/shields
[travis-svg]: https://img.shields.io/travis/KenanY/shields.svg
[gemnasium]: https://gemnasium.com/KenanY/shields
[gemnasium-svg]: https://img.shields.io/gemnasium/KenanY/shields.svg
`
Or from the API:
` javascript
var shields = require('shields')();
shields('travis', {
repo: 'KenanY/shields'
});
// => {
// => text: 'Build status',
// => image: 'https://img.shields.io/travis/KenanY/shields.svg?style=flat',
// => link: 'https://travis-ci.org/KenanY/shields'
// => }
`
For the command-line executable:
` bash`
$ npm install -g shields
For the API:
` bash`
$ npm install shields
` javascript`
var shielder = require('shields');
- opts.style is the style of the shield. The available styles are: flat (the
default one), flat-square and plastic.
` js`
var shields = shielder({
style: 'plastic'
})
- service is a _String_ representing the service for which the shield willopts.repo
be created. Currently supported values are: npm, travis, coveralls, climate,
deps, devdeps, peerdeps, gemnasium.
- is the GitHub repo targeted by the shield. For the current repoKenanY/shields
the value would be .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 isnpm
created. This value is currently required only by the shield.
The shields 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 websiteservice
of obj.text
- is a _String_ label for the service`
[travis]: https://travis-ci.org/KenanY/shields
[travis-svg]: https://img.shields.io/travis/KenanY/shields.svg
[gemnasium]: https://gemnasium.com/KenanY/shields
[gemnasium-svg]: https://img.shields.io/gemnasium/KenanY/shields.svg