Visualize stats about GitHub users and projects in your terminal.
This project is under the git-stats
umbrella. git-stats
tracks your local commits and the visualization is similar. ❇️
github-profile-languages
provides the same pie chart visualization, but in browser (for users and repositories).
You can install the package globally and use it as command line tool:
$ npm i -g github-stats
Then, run github-stats --help
and see what the CLI tool can do.
$ github-stats --help
Usage: github-stats [options]
Options:
-u, --user <user> The GitHub user to get stats about.
-r, --repo <repository> The full repository name.
-n, --no-ansi Disable ansi styles.
-l, --light Use the light theme.
-c, --calendar Show the calendar.
--user-stats, --us Display user stats.
--repo-stats, --rs Display repository stats.
-t, --token <token> GitHub access token to access private resources or
to increase the rate limit.
-h, --help Displays this help.
-v, --version Displays version information.
Examples:
gh-stats -u IonicaBizau -r gh-stats --us --rs -c # Show everything
gh-stats -u IonicaBizau # Show the calendar
gh-stats -r IonicaBizau/git-stats # Repository stats
Documentation can be found at https://github.com/IonicaBizau/gh-stats
Here is an example how to use this package as library. To install it locally, as library, you can do that using npm
:
$ npm i --save github-stats
// Dependencies
var GitHubStats = require("github-stats");
// Create the GitHubStats instance
var stats = new GitHubStats({
// Enable light theme for calendar
theme: "LIGHT"
// Provide the repository and the username
, repo: "hubber-memory-game"
, user: "alysonla"
// Visualize repository, user and calendar stats
, s_repo: true
, s_user: true
, cal: true
// A token could help to visualize private stats
, token: "an optional token"
});
// Stringify everything
stats.toString(function (err, output, warns) {
console.log(err || output);
});
For full API reference, see the DOCUMENTATION.md file.
Have an idea? Found a bug? See how to contribute.
Another way to support the development of my open-source modules is to set up a recurring donation, via Patreon. 🚀
PayPal donations are appreciated too! Each dollar helps.
Thanks! ❤️