Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Small NPM package for collecting your own GitHub statistics

License

NotificationsYou must be signed in to change notification settings

TomerFi/github-viewer-stats

Repository files navigation

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 aGITHUB_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 useread:org instead.
Of course if won't use this tool for retrieving organization statistics, you can omit theadmin all together.

Use as a module

npm install --save github-viewer-stats

// print my user statistics to the consolerequire('github-viewer-stats').contribs().then(r=>console.log(JSON.stringify(r,null,2)));// print cool-org-name organization statistics to the consolerequire('github-viewer-stats').org('cool-org-name').then(r=>console.log(JSON.stringify(r,null,2)));// print my aioswitcher repository statistics to the consolerequire('github-viewer-stats').repo('aioswitcher').then(r=>console.log(JSON.stringify(r,null,2)));
Detailed example

const{ contribs, org, repo}=require('github-viewer-stats');asyncfunctionmain(){// collect my user statisticsletmyContributions=awaitcontribs();console.log(JSON.stringify(myContributions,null,2));// collect cool-org-name organization statisticsletmyOrg=awaitorg('cool-org-name');console.log(JSON.stringify(myOrg,null,2));// collect my aioswitcher repository statisticsletmyRepo=awaitrepo('aioswitcher');console.log(JSON.stringify(myRepo,null,2));}main();


[8]ページ先頭

©2009-2025 Movatter.jp