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

github-badge

v0.5.5

Published

A jQuery widget to show-off your GitHub Repositories.

Downloads

21

Readme

GitHub Badge

Bower version Build Status DevDependencies Status ghit.me

Github Repo Demonstration

A widget to show-off your Github Repositories.

Takes the best of ricardobeat/github-repos and zenorocha/jquery-github and adds:

  • Option to display the number of watchers
  • Official GitHub font for icons
  • Configurable date format

NOW, no longer requires jQuery or Zepto!

Browser Support

We do care about it.

IE | Chrome | Firefox | Opera | Safari --- | --- | --- | --- | --- | IE 8+ ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ |

Getting started

Three quick start options are available:

Setup

Use Bower to fetch all dependencies:

$ bower install

Now you're ready to go!

Usage

Create an attribute called data-repo:

<div data-repo="jquery-boilerplate/jquery-boilerplate"></div>

Include widget's CSS and JS:

<link rel="stylesheet" href="assets/base.css">
<script src="github-badge.min.js"></script>

Make sure the font is in the same directory as the base.css (or change base.css to reference the correct directory):

Fonts in same directory as css

Call the plugin:

GHBadges.create("[data-repo]");

Or call it with options

GHBadges.create("[data-repo]", {iconStars: true,
								iconWatchers: true,
								iconForks: true,
								iconIssues: true,
								dateFormat: "M/D/Y"});

And that's it.

Check full example's source code.

Options

Here's a list of available settings.

GHBadges.create("[data-repo]", {
	iconStars:  false,
	iconWatchers: true,
	iconForks:  true,
	iconIssues: false,
	dateFormat: "D/M/Y"
});

Attribute | Type | Default | Description --- | --- | --- | --- iconStars | Boolean | false | Displays the number of stars in a repository. iconWatchers| Boolean | true | Displays the number of watchers in a repository. iconForks | Boolean | true | Displays the number of forks in a repository. iconIssues | Boolean | false | Displays the number of issues in a repository. dateFormat | String | "D/M/Y" | Specifies what format the date should be display as.

Structure

The basic structure of the project is given in the following way:

.
|-- assets/
|-- demo/
|   |-- index.html
|   |-- index-zepto.html
|-- dist/
|   |-- github-badge.js
|   |-- github-badge.min.js
|-- src/
|   |-- github-badge.js
|   |-- github-badge.template.js
|   |-- template.html
|-- .editorconfig
|-- .gitignore
|-- .jshintrc
|-- .travis.yml
|-- bower.json
|-- github-badge.json
|-- Gruntfile.js
`-- package.json

assets/

Contains CSS and Font files to create that lovely Github box.

demo/

Contains a simple HTML file to demonstrate the plugin.

dist/

This is where the generated files are stored once Grunt runs JSHint and other stuff.

src/

Contains the files responsible for the plugin.

.editorconfig

This file is for unifying the coding style for different editors and IDEs.

Check editorconfig.org if you haven't heard about this project yet.

.gitignore

List of files that we don't want Git to track.

Check this Git Ignoring Files Guide for more details.

.jshintrc

List of rules used by JSHint to detect errors and potential problems in JavaScript.

Check jshint.com if you haven't heard about this project yet.

.travis.yml

Definitions for continous integration using Travis.

Check travis-ci.org if you haven't heard about this project yet.

gihub-badge.json

Package manifest file used to publish plugins in jQuery Plugin Registry.

Check this Package Manifest Guide for more details.

Gruntfile.js

Contains all automated tasks using Grunt.

Check gruntjs.com if you haven't heard about this project yet.

package.json

Specify all dependencies loaded via Node.JS.

Check NPM for more details.

Showcase

Have you used this plugin in your project?

Let me know! Send a tweet or pull request and I'll add it here :)

Alternatives

Prefer AngularJS?

No problem, @lucasconstantino already did that. Check his fork!

Contributing

Check CONTRIBUTING.md.

History

Check Releases for detailed changelog.

Credits

Based on zenorocha/jquery-github and ricardobeat/github-repos

License

MIT License © Joel Self