Creating customizable metadata badges.
MIT License
See gh-badges for a more stable version.
yarn add badge-studio
You can try it online in the browser!
const badge = require('badge-studio')
// Optional
badge.loadFont('/path/to/Verdana.ttf', err => {
// optional error callback
})
badge({
subject: 'build',
status: 'passing'
})
// => <svg...
Then you will get an SVG string which renders:
Or add a logo:
badge({
logo: 'https://vuejs.org/images/logo.png',
subject: 'vue',
status: {
text: '^2.3',
bgColor: '#ff69b4'
}
})
And you get:
Type: string
Default: default
Possible: default
square
Choose a badge template.
Type: string
Default: #fff
Text color for both subject
and status
.
Type: string
Default: #010101
Shadow color for both subject
and status
. No shadow in square template.
Type: string
Object
subject
is similar to status
except that we put subject
on the left and status
on the right.
When it's a string, it's simply a shorthand of { text: string }
.
Type: string
The text to display.
Type: string
Text color for subject
or status
.
Type: string
Default: #555
for subject
, #4c1
for status
Background color for subject
or status
.
Type: string
Shadow color for subject
or status
.
Type: string
object
Type: string
URL to an image.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
badge-studio © egoist, Released under the MIT License. Authored and maintained by egoist with help from contributors (list).
egoistian.com · GitHub @egoist · Twitter @_egoistlily