npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

badge-forge

v1.3.0

Published

Badge Forge transforms your configuration into a glorious set of shields.io badges, making your GitHub README shine.

Readme

🛠️ Badge Forge – Forge Your Own Badges! 🔥

Badge Forge Badge Forge version Github stars Code coverage Continuous integration Prettier

Why waste time manually adding badges when you can forge them like a pro? ⚒️🔥

Badge Forge transforms your configuration into a glorious set of shields.io badges, making your GitHub README shine ✨.

🚀 Why Use Badge Forge?

  • ✅ Automated badge generation – no more manual badge tinkering
  • ✅ Super simple setup – just run it and let the magic happen
  • ✅ Instantly boost your repo’s style points 😎
  • ✅ Faster than a blacksmith on caffeine ☕⚡

💾 Installation

npm install -g badge-forge

Start forging today! 🏗️🔗

🛠 Badge Forge – Configuration Guide & Usage

1️⃣ Basic Usage

badge-forge generate

✅ Automatically loads the configuration from supported config files and generates badges.

2️⃣ Supported Configuration File Formats

Since Badge Forge uses cosmiconfig, it supports multiple configuration file formats and locations.

📌 Supported File Names (searched automatically) The tool will look for configuration files in the following order:

  • YAML:
    • .badge-forgerc.yml
    • .badge-forgerc.yaml
  • JSON:
    • .badge-forgerc.json
  • JavaScript / TypeScript:
    • .badge-forgerc.js
    • .badge-forgerc.ts
    • badge-forge.config.js
    • badge-forge.config.ts
  • Package JSON (package.json)
    • Looks for a "badgeForge" key inside package.json

3️⃣ Example Configurations for Each Format

📄 YAML (.badge-forgerc.yml or .badge-forgerc.yaml)

badges:
    - label: Stars
      message: '{} ⭐'
      source: https://api.github.com/search/repositories?q=%22badge-forge%22
      path: $.items[?(@.full_name=='bakajvo/badge-forge')].stargazers_count
      color: 3dc8ff

    - label: Badge
      message: Forge 🔥🔨
      color: b58259

    - label: Version
      message: '{}'
      source: package.json
      path: $.version
      color: 6aff3d

    - label: Coverage
      message: '{}%'
      source: coverage/coverage-summary.json
      path: $.total.statements.pct
      color: db0921

    - label: Code style
      message: prettier
      color: ff69b4
      filename: Prettier

📄 JSON (.badge-forgerc.json)

{
    "badges": [
        {
            "label": "Stars",
            "message": "{} ⭐",
            "source": "https://api.github.com/search/repositories?q=%22badge-forge%22",
            "path": "$.items[?(@.full_name=='bakajvo/badge-forge')].stargazers_count",
            "color": "3dc8ff"
        },
        {
            "label": "Badge",
            "message": "Forge 🔥🔨",
            "color": "b58259"
        },
        {
            "label": "Version",
            "message": "{}",
            "source": "package.json",
            "path": "$.version",
            "color": "6aff3d"
        },
        {
            "label": "Coverage",
            "message": "{}%",
            "source": "coverage/coverage-summary.json",
            "path": "$.total.statements.pct",
            "color": "db0921"
        },
        {
            "label": "Code style",
            "message": "prettier",
            "color": "ff69b4",
            "filename": "Prettier"
        }
    ]
}

📄 JavaScript (badge-forge.config.js/ts or .badge-forgerc.js/ts)

export default {
    badges: [
        {
            label: 'Stars',
            message: '{} ⭐',
            source: 'https://api.github.com/search/repositories?q=%22badge-forge%22',
            path: "$.items[?(@.full_name=='bakajvo/badge-forge')].stargazers_count",
            color: '3dc8ff',
        },
        {
            label: 'Badge',
            message: 'Forge 🔥🔨',
            color: 'b58259',
        },
        {
            label: 'Version',
            message: '{}',
            source: 'package.json',
            path: '$.version',
            color: '6aff3d',
        },
        {
            label: 'Coverage',
            message: '{}%',
            source: 'coverage/coverage-summary.json',
            path: '$.total.statements.pct',
            color: 'db0921',
        },
        {
            label: 'Code style',
            message: 'prettier',
            color: 'ff69b4',
            filename: 'Prettier',
        },
    ],
}

📄 Adding Configuration Inside package.json Instead of creating a separate file, you can add the configuration inside package.json:

{
    "name": "my-project",
    "version": "1.0.0",
    "badgeForge": {
        "badges": [
            {
                "label": "Stars",
                "message": "{} ⭐",
                "source": "https://api.github.com/search/repositories?q=%22badge-forge%22",
                "path": "$.items[?(@.full_name=='bakajvo/badge-forge')].stargazers_count",
                "color": "3dc8ff"
            },
            {
                "label": "Badge",
                "message": "Forge 🔥🔨",
                "color": "b58259"
            },
            {
                "label": "Version",
                "message": "{}",
                "source": "package.json",
                "path": "$.version",
                "color": "6aff3d"
            }
        ]
    }
}

✅ This allows badge-forge to fetch configuration directly from package.json.

4️⃣ Using in CI/CD Pipelines

📌 Add a script in package.json

{
    "scripts": {
        "generate-badges": "badge-forge generate"
    }
}

Example of GitHub Action workflow that runs Badge Forge on every push to main or daily at midnight (UTC). 🚀

📌 .github/workflows/badge-forge.yml

name: Generate Badges

on:
push:
branches:
  - main
schedule:
  - cron: "0 0 * * *" # Runs daily at midnight UTC

jobs:
generate-badges:
  runs-on: ubuntu-latest
  steps:
    - name: Checkout repository
      uses: actions/checkout@v4

    - name: Setup Node.js
      uses: actions/setup-node@v4
      with:
        node-version: 22
        cache: "npm"

    - name: Install dependencies
      run: npm ci

    - name: Generate badges
      run: npm run generate-badges # Ensure this script exists in package.json

    - name: Commit and push changes
      run: |
        git config --global user.name "github-actions[bot]"
        git config --global user.email "github-actions[bot]@users.noreply.github.com"
        git add README.md
        git commit -m "Auto-update badges" || echo "No changes to commit"
        git push