Skip to content

rsudarson/my-badges

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

my-badges

status version dependencies devDependencies

Generate useful badges

Usage

npm i my-badges -g

Suppose you are now under the repository task-tape.

Full badges

⌘ mybadges --full

dependencies devDependencies status downloads version npm license node

Major badges

⌘ mybadges --major

dependencies devDependencies status version npm

Minor badges

⌘ mybadges --minor

status version npm

Command line options


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'

API

var create = require('my-badges')

rv = create(type, data, extra)

type

Type: String

mybadges -h to see possible values.

data

Type: Object

Data for creating badges.

  • user: github user name
  • repo: github repo name
  • name: package name

extra

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.

rv

Type: Object

  • src: Image src
  • href: Link href
  • img: Image markdown
  • link: Link markdown

Before you run mybadges

There are a few badges you have to do some configure to make them work.

Travis

Sign in travis, activate your repo, and push a .travis.yml.

Coverage

Sign in coveralls, activate your repo, and push a .coveralls.yml

About

Generate useful badges

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%