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 🙏

© 2024 – Pkg Stats / Ryan Hefner

on-the-githubs

v2.4.0

Published

Uses GitHub API3 to aggregate community activity of open source projects

Downloads

71

Readme

on-the-githubs

Build Status NPM version Dependency Status Development Dependency Status

Gittip donate button Flattr donate button PayPayl donate button BitCoin donate button

Demo: http://kvz.github.io/on-the-githubs/#repos/kvz/nsfailover

To grow an open-source community it helps if your site has an active overview of what's going on and who is contributing.

The GitHub API3 provides all the information we need, but you may hit rate-limiters, or find it hard / have no time to embed this data into your website.

This project aims to make it deadsimple to add community info & activity feeds to your project's site.

On the Githubs example

On the Githubs is a jquery plugin for a near-realtime overview of activity of a user, project or organisation. It does not require any buildsteps or setup, just add a few lines of code to your project's HTML.

Demo: http://kvz.github.io/on-the-githubs/#repos/kvz/nsfailover

Or your own:

  • http://kvz.github.io/on-the-githubs/#repos/{user}/{repo}
  • http://kvz.github.io/on-the-githubs/#users/{user}
  • http://kvz.github.io/on-the-githubs/#orgs/{org}

To embed this into your site, add a few lines of code:

<link href="//kvz.github.io/on-the-githubs/css/on-the-githubs.min.css" rel="stylesheet" />

<div class="on-the-githubs" data-event-source="repos/kvz/nsfailover">Loading...</div>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="//kvz.github.io/on-the-githubs/js/jquery.on-the-githubs.min.js"></script>

<script type="text/javascript">
  $('.on-the-githubs').onthegithubs();
  // If you use bootstrap and want to enable tooltips
  // $('a[rel]').tooltip();
</script>

Don't forget to change the data-event-source to repos/{user}/{repo}.

On the Githubs development

For local development, here's how to run the repo-included demo:

npm install --dev
make build
node demo-server.js
  • Point your browser to http://127.0.0.1:8080

Bonus: In the Githubs

Activity is limited to the last 20-100 events, but communities grow big. If you want to give credit where credit is due and show all the faces that make your community, we can't just pull that in in realtime from the API without hindering the UI or hitting GitHub's rate-limiter.

So this is something we have to aggregate, cache, and compile at your site's buildtime.

In the Githubs examples

Get all people involved with kvz/nsfailver and echo as json to stdout

./bin/in-the-githubs --user kvz --repo nsfailover --format json --output -

Index an entire organization, read test/about.md, search it for the {{community}} tag, replace it with the entire tus community, write it to test/about-with-community.md, do this with 1 request at a time, to ensure the order of userpaths. Enable debugging to see what's going on, because with the amount of API requests & GitHubs rate-limiting, this is going to take a while (the script automatically waits as to not have your IP banned by GitHub).

./bin/in-the-githubs \
 --user tus \
 --repo tus.io,tusd,tus-jquery-client,tus-ios-client,tus-android-client,tus-resumable-upload-protocol \
 --format html \
 --concurrency 1 \
 --input demo.html \
 --tag '<div class="in-the-githubs" />' \
 --output demo-with-community.html \
 --debug

Help:

./bin/in-the-githubs -h

Integrate In the Githubs

Let's say your site is now built with Jekyll into ./_site. You have an about.md that you want to add community faces to.

First, let's make on-the-githubs a dependency:

[ -d node_modules ] || mkdir node_modules
npm install on-the-githubs --save

Now add something like this to a Makefile:

community:
	node_modules/on-the-githubs/bin/in-the-githubs \
	 --user tus \
	 --repo tusd,tus-jquery-client \
	 --format html \
	 --concurrency 1 \
	 --input _site/about.html \
	 --tag '<p>replaced-by-in-the-githubs</p>' \
	 --output _site/about.html \
	 --debug

Now if you type make community after jekyll build, in-the-githubs will look for the <p>replaced-by-in-the-githubs</p> placeholder, and replace it with all the involved GitHub profiles.

By default, in-the-githubs caches to ~/.in-the-githubs/ to avoid rate-limiters.

Requirements

  • Node 0.8+

License

This project is licensed under the MIT license, see LICENSE.txt.

Contains code of jquery-timeago by Ryan McGeary