Generate useful badges
npm i my-badges -g
Suppose you are now under the repository task-tape
.
⌘ mybadges --full
⌘ mybadges --major
⌘ mybadges --minor
mybadges [-dDsoplnvUR] [--major] [--full] [--minor] [package_name]
Create badges: 'dependencies', 'devDependencies', 'status', 'downloads', 'version', 'npm', 'license', 'node'.
Please run this command in the package directory, or provide enough information through the command line.
-c, --coverage
-d, --dependencies
-D, --devDependencies
-s, --status
build status
-o, --downloads
downloads from npm per month
-p, --npm
link to npm
-l, --license
-n, --node
node version compatibility
-v, --version
npm package version
-U, --user
followed by github user name
-R, --repo
followed by github repo name. If not specified, it is the same with the package_name
-h, --help
show the help text
--minor
'status', 'npm', 'version'
--major
'status', 'dependencies', 'devDependencies', 'npm', 'version'
--full
'dependencies', 'devDependencies', 'status', 'downloads', 'version', 'npm', 'license', 'node'
var create = require('my-badges')
Type: String
mybadges -h
to see possible values.
Type: Object
Data for creating badges.
user
: github user namerepo
: github repo namename
: package name
Type: Object
Custom templates.
Take the build status badge for example:
exports.status = {
test: hasUserinfo,
src: 'https://travis-ci.org/{{user}}/{{repo}}.svg?branch=master',
href: 'https://travis-ci.org/{{user}}/{{repo}}',
img: '![status]({{src}})',
link: '[{{img}}]({{href}})',
}
You can override img
or link
by specifying them in extra
.
Type: Object
src
: Image srchref
: Link hrefimg
: Image markdownlink
: Link markdown
There are a few badges you have to do some configure to make them work.
Sign in travis,
activate your repo,
and push a .travis.yml
.
- http://docs.travis-ci.com/user/getting-started/
- http://docs.travis-ci.com/user/languages/javascript-with-nodejs/
Sign in coveralls,
activate your repo,
and push a .coveralls.yml