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

github-viewer-stats

v1.0.4

Published

Small NPM package for collecting your own GitHub statistics

Downloads

36

Readme

Run as a script (using my own token)

npx github-viewer-stats contribs
{
  "name": "Tomer Figenblat",
  "company": "Red Hat",
  "status": "pr is coming",
  "contributingSince": 2017,
  "totalContributions": 10239,
  "contributionsCollection": {
    "totalCommitContributions": 7561,
    "totalIssueContributions": 114,
    "totalPullRequestContributions": 377,
    "totalPullRequestReviewContributions": 663,
    "totalRepositoriesWithContributedCommits": 202,
    "totalRepositoriesWithContributedIssues": 52,
    "totalRepositoriesWithContributedPullRequestReviews": 39,
    "totalRepositoriesWithContributedPullRequests": 98,
    "totalRepositoryContributions": 131,
    "totalDiscussionContributions": 80,
    "totalGistContributions": 7,
    "totalPackageContributions": 0
  }
}
npx github-viewer-stats repo aioswitcher
{
  "name": "aioswitcher",
  "description": "PyPi module integrating with various Switcher devices",
  "language": "Python",
  "license": "apache-2.0",
  "collaborators": 2,
  "forks": 9,
  "stars": 14,
  "watchers": 2,
  "latest": "3.2.1"
}
npx github-viewer-stats org my-organization
{
  "name": "My Organization Name",
  "description": "My organization description",
  "members": 217,
  "teams": 2,
  "repositories": 16,
  "pending": 0,
  "twoFactorAuthentication": false,
  "webCommitSignoff": false,
  "websiteUrl": "https://my-org-site.com/"
}

admin:org is only required for admin level organization stats, such as 2fa and pending members. If you do not require these admin properties or do not have admin permission to the organization to begin with, you can use read:org instead. Of course if won't use this tool for retrieving organization statistics, you can omit the admin all together.

npm install --save github-viewer-stats
// print my user statistics to the console
require('github-viewer-stats').contribs().then(r => console.log(JSON.stringify(r, null, 2)));
// print cool-org-name organization statistics to the console
require('github-viewer-stats').org('cool-org-name').then(r => console.log(JSON.stringify(r, null, 2)));
// print my aioswitcher repository statistics to the console
require('github-viewer-stats').repo('aioswitcher').then(r => console.log(JSON.stringify(r, null, 2)));
const { contribs, org, repo } = require('github-viewer-stats');

async function main() {
  // collect my user statistics
  let myContributions = await contribs();
  console.log(JSON.stringify(myContributions, null, 2));

  // collect cool-org-name organization statistics
  let myOrg = await org('cool-org-name');
  console.log(JSON.stringify(myOrg, null, 2));

  // collect my aioswitcher repository statistics
  let myRepo = await repo('aioswitcher');
  console.log(JSON.stringify(myRepo, null, 2));
}

main();