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

aggregithub

v0.2.3

Published

aggregate github statistics

Downloads

6

Readme

aggregithub

Aggregate your GitHub statistics for fun and profit!

Installation

Install with npm:

npm install -g aggregithub

Usage

aggregithub is a command-line tool that generates JSON on standard output:

aggregithub [options] <repos> <aggregate type> [aggregate options]

Options:
  --auth          your GitHub API access token (default: process.env.GITHUB_AUTH_TOKEN)
                  or credentials in the form "username:password"
  --include, -i   only include repo names with this glob-like pattern
  --exclude, -e   exclude repos matching this glob-like pattern
  --parallel, -p  do this many API requests in parallel [default: 10]

Note: you will very likely run into GitHub API rate limits if you don't provide the --auth option or set the GITHUB_AUTH_TOKEN environment variable. You can get a personal access token on your GitHub settings page, then export it like so:

export GITHUB_AUTH_TOKEN="your-super-secret-token"

You should also considering putting this in a .env file and using autoenv to have it sourced whenever you enter the directory that contains it. However you decide to do it, remember to back up your token somewhere safe, because you won't be able to get it from GitHub again.

Examples

Get commit totals for a user's repos:

aggregithub users/shawnbot commits total > shawnbot-commits.json

Get daily and weekly commit totals for an organization:

aggregithub orgs/18F commits > 18F-commits.json

Available Statistics

commits [rollup types]

Uses the commit activity API to get total, daily and weekly commit counts within the last year. Rollup types are any of the following:

  • total: the total number of commits
  • weekly: weekly rollups as an object with keys in the form YYYY-MM-DD
  • daily: daily rollups as an object with keys in the form YYYY-MM-DD

For instance:

$ aggregithub users/username commits total
{
  "total": 520
}

issues [event types]

Looks at all of the issue events for one or more repositories and rolls up the number of events by type. If no event types are provided, the default is to list opened and closed events. Examples:

# just list opened and closed
$ aggregithub users/username issues
{
  "opened": 200,
  "closed": 100
}
# list opened, closed and PRs merged
$ aggregithub users/username issues opened closed merged
{
  "opened": 200,
  "closed": 100,
  "merged": 50
}