Generators

badges


The badges generator generates badges for the latest npm version, npm download statistics, code coverage, and bundle size.

Example

Input

<!-- automd:badges color="yellow" license name="defu" codecov bundlephobia packagephobia -->
<!-- /automd -->

Output

<!-- automd:badges color="yellow" license name="defu" codecov bundlephobia packagephobia -->

[![npm version](https://img.shields.io/npm/v/defu?color=yellow)](https://npmjs.com/package/defu)
[![npm downloads](https://img.shields.io/npm/dm/defu?color=yellow)](https://npmjs.com/package/defu)
[![bundle size](https://img.shields.io/bundlephobia/minzip/defu?color=yellow)](https://bundlephobia.com/package/defu)
[![codecov](https://img.shields.io/codecov/c/gh/unjs/automd?color=yellow)](https://codecov.io/gh/unjs/automd)
[![license](https://img.shields.io/github/license/unjs/automd?color=yellow)](https://github.com/unjs/automd/blob/main/LICENSE)

<!-- /automd -->

Arguments

name
string

The npm package name. By default tries to infer from package.json

github
string

Github repository name. By default tries to infer from package.json

license
boolean

Show license badge (requires github)

licenseBranch
string

Branch to use for license badge defaults to main

bundlephobia
boolean

Show Bundlephobia badge (requires name)

codecov
boolean

Enable Codecov badge (requires github)

no-npmDownloads
boolean

Hide npm downloads badge

no-npmVersion
boolean

Hide npm version badge

provider
string

Can be one of shields (for shields.io) or badgen / badgenClassic (for badgen.net). Default is badgen.

You can use additional args color, labelColor to customize style. For provider specific params, use styleParams.