githubmarkdownbadge

How to implement a simple github markdown badge to show monthly download


As titled, I would like to have a badge for, let's say, this repo

Looking online, I found, for example, this:

[![npm](https://img.shields.io/npm/dm/localeval.svg)]() npm

I tried to embed in all the possible ways [![npm](https://img.shields.io/npm/dm/kotlin-graphics/kotlin-unsigned.svg)]() npm

but I always get invalid or 0 (which cannot be because I saw the github statistics)

What am I missing?


Solution

  • The npm in your URL stands for Node package manager which is not what you want. Use the URL for Github instead:

    Total downloads: Github Downloads (total)

    [![Github Downloads (total)](https://img.shields.io/github/downloads/kotlin-graphics/kotlin-unsigned/total.svg)]()

    Unfortunately it does not seem to be possible to get a badge for the monthly downloads like this. But maybe you want to show the download count for the latest release:

    Github Downloads (monthly)

    [![Github Downloads (monthly)](https://img.shields.io/github/downloads/kotlin-graphics/kotlin-unsigned/latest/total.svg)]()