Git Product home page Git Product logo

github-viewer-stats's Introduction

Collect Your Own GitHub Statistics

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/"
}

Requires a GITHUB_TOKEN environnement variable (click for the scopes)

  • repo
  • read:packages
  • read:user
  • read:discussion
  • admin:org

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.

Use as a module

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)));
Detailed example

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();

github-viewer-stats's People

Contributors

dependabot[bot] avatar tomerfi avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

github-viewer-stats's Issues

Convert to ESModule?

What did you have in mind?

Lately, A lot of NodeJS packages have migrated from CommonJS to ESModules.
The following PRs are blocked:

Also, see TomerFi/auto-me-bot#400.

A choice is required: either migrate to ESModule or switch the require statements to dynamic import ones.

Are you trying to fix a problem?

No response

Any lead on how this feature can be implemented?

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.