• Stars
    star
    6,226
  • Rank 6,430 (Top 0.2 %)
  • Language
    HTML
  • License
    MIT License
  • Created almost 10 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ€ Local git statistics including GitHub-like contributions calendars.

git-stats

$ git-stats

Support me on Patreon Buy me a book PayPal Ask me anything Version Downloads Get help on Codementor

Buy Me A Coffee

Local git statistics including GitHub-like contributions calendars.

I'd be curious to see your calendar with all your commits. Ping me on Twitter (@IonicaBizau). ๐Ÿ˜„ Until then, here's my calendar:

Contents

โ˜๏ธ Installation

You can install the package globally and use it as command line tool:

# Install the package globally
npm i -g git-stats

# Initialize git hooks
# This is for tracking the new commits
curl -s https://raw.githubusercontent.com/IonicaBizau/git-stats/master/scripts/init-git-post-commit | bash

Then, run git-stats --help and see what the CLI tool can do.

$ git-stats --help
Usage: git-stats [options]

Local git statistics including GitHub-like contributions calendars.

Options:
  -r, --raw              Outputs a dump of the raw JSON data.
  -g, --global-activity  Shows global activity calendar in the current
                         repository.
  -d, --data <path>      Sets a custom data store file.
  -l, --light            Enables the light theme.
  -n, --disable-ansi     Forces the tool not to use ANSI styles.
  -A, --author           Filter author related contributions in the current
                         repository.
  -a, --authors          Shows a pie chart with the author related
                         contributions in the current repository.
  -u, --until <date>     Optional end date.
  -s, --since <date>     Optional start date.
  --record <data>        Records a new commit. Don't use this unless you are
                         a mad scientist. If you are a developer just use
                         this option as part of the module.
  -h, --help             Displays this help.
  -v, --version          Displays version information.

Examples:
  $ git-stats # Default behavior (stats in the last year)
  $ git-stats -l # Light mode
  $ git-stats -s '1 January 2012' # All the commits from 1 January 2012 to now
  $ git-stats -s '1 January 2012' -u '31 December 2012' # All the commits from 2012

Your commit history is kept in ~/.git-stats by default. You can create
~/.git-stats-config.js to specify different defaults.

Documentation can be found at https://github.com/IonicaBizau/git-stats.

Usage

Importing and deleting commits

I know it's not nice to start your git commit calendar from scratch. That's why I created git-stats-importerโ€“a tool which imports or deletes the commits from selected repositories.

Check it out here: https://github.com/IonicaBizau/git-stats-importer

The usage is simple:

# Install the importer tool
$ npm install -g git-stats-importer

# Go to the repository you want to import
$ cd path/to/my-repository

# Import the commits
$ git-stats-importer

# ...or delete them if that's a dummy repository
$ git-stats-importer --delete

Importing all the commits from GitHub and BitBucket

Yes, that's also possible. I built a tool which downloads and then imports all the commits you have pushed to GitHub and BitBucket!

# Download the repository downloader
$ git clone https://github.com/IonicaBizau/repository-downloader.git

# Go to repository downloader
$ cd repository-downloader

# Install the dependencies
$ npm install

# Start downloading and importing
$ ./start

What about the GitHub Contributions calendar?

If you want to visualize the calendars that appear on GitHub profiles, you can do that using ghcal.

# Install ghcal
$ npm install -g ghcal

# Check out @alysonla's contributions
$ ghcal -u alysonla

For more detailed documentation, check out the repository: https://github.com/IonicaBizau/ghcal.

If want to get even more GitHub stats in your terminal, you may want to try github-stats--this is like git-stats but with data taken from GitHub.

Using the configuration file

You can tweak the git-stats behavior using a configuration file in your home directory: ~/.git-stats-config.js.

This file should export an object, like below (defaults are listed):

module.exports = {
    // "DARK", "LIGHT" or an object interpreted by IonicaBizau/node-git-stats-colors
    "theme": "DARK"

    // The file where the commit hashes will be stored
  , "path": "~/.git-stats"

    // First day of the week
  , first_day: "Sun"

    // This defaults to *one year ago*
    // It can be any parsable date
  , since: undefined

    // This defaults to *now*
    // It can be any parsable date
  , until: undefined

    // Don't show authors by default
    // If true, this will enable the authors pie
  , authors: false

    // No global activity by default
    // If true, this will enable the global activity calendar in the current project
  , global_activity: false
};

Since it's a js file, you can require any other modules there.

Saving the data as HTML and images

git-stats --raw outputs raw JSON format which can be consumed by other tools to generate results such as HTML files or images.

git-stats-html interprets the JSON data and generates an HTML file. Example:

# Install git-stats-html

npm install -g git-stats-html



# Export the data from the last year (generate out.html)

git-stats --raw | git-stats-html -o out.html



# Export data since 2015 (save the results in out.html)

git-stats --since '1 January 2015' --raw | ./bin/git-stats-html -o out.html --big

After we have the HTML file, we can generate an image file using pageres by @sindresorhus:

# Install pageres

npm install -g pageres-cli



# Generate the image from HTML

pageres out.html 775x250

Cross-platform compatibility

git-stats is working fine in terminal emulators supporting ANSI styles. It should work fine on Linux and OS X.

If you run git-stats to display graph on Windows, please use a terminal that can properly display ANSI colors.

Cygwin Terminal is known to work, while Windows Command Prompt and Git Bash do not. Improvements are more than welcome! ๐Ÿ’ซ

๐Ÿ“‹ Example

Here is an example how to use this package as library. To install it locally, as library, you can use npm install git-stats (or yarn add git-stats):

// Dependencies
var GitStats = require("git-stats");

// Create the GitStats instance
var g1 = new GitStats();

// Display the ansi calendar
g1.ansiCalendar({
    theme: "DARK"
}, function (err, data) {
    console.log(err || data);
});

โ“ Get Help

There are few ways to get help:

  1. Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
  2. For bug reports and feature requests, open issues. ๐Ÿ›
  3. For direct and quick help, you can use Codementor. ๐Ÿš€

๐Ÿ“ Documentation

For full API reference, see the DOCUMENTATION.md file.

๐Ÿ“ฐ Press Highlights

๐Ÿ˜‹ How to contribute

Have an idea? Found a bug? See how to contribute.

๐Ÿ’– Support my projects

I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).

However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:

  • Starring and sharing the projects you like ๐Ÿš€

  • Buy me a bookโ€”I love books! I will remember you after years if you buy me one. ๐Ÿ˜ ๐Ÿ“–

  • PayPalโ€”You can make one-time donations via PayPal. I'll probably buy a coffee tea. ๐Ÿต

  • Support me on Patreonโ€”Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).

  • Bitcoinโ€”You can send me bitcoins at this address (or scanning the code below): 1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6

Thanks! โค๏ธ

๐Ÿ’ซ Where is this library used?

If you are using this library in one of your projects, add it in this list. โœจ

  • git-stats-importer
  • git-stats-fcc-importer

๐Ÿ“œ License

MIT ยฉ Ionicฤƒ Bizฤƒu

More Repositories

1

scrape-it

๐Ÿ”ฎ A Node.js scraper for humans.
JavaScript
3,928
star
2

image-to-ascii

๐Ÿ’พ A Node.js module that converts images to ASCII art.
JavaScript
1,525
star
3

github-contributions

:octocat: A tool that generates a repository which being pushed into your GitHub account creates a nice contributions calendar.
HTML
1,326
star
4

gridly

โšก The minimal (~100-170 bytes) grid system for modern browsers.
HTML
966
star
5

medium-editor-markdown

๐Ÿ“ A Medium Editor extension to add markdown support.
JavaScript
766
star
6

node-cobol

๐Ÿ“บ COBOL bridge for NodeJS which allows you to run COBOL code from NodeJS.
COBOL
691
star
7

json2md

๐Ÿ“Œ A JSON to Markdown converter.
JavaScript
520
star
8

cli-github

๐Ÿ˜ธ A fancy GitHub client for command line.
JavaScript
428
star
9

youtube-api

๐Ÿ“น A Node.JS module, which provides an object oriented wrapper for the YouTube v3 API.
JavaScript
350
star
10

github-stats

๐Ÿ“ˆ Visualize stats about GitHub users and projects in your terminal.
JavaScript
275
star
11

github-profile-languages

๐Ÿ“บ Create a nice pie chart with the user's programming languages from their GitHub profile.
JavaScript
249
star
12

ghcal

๐Ÿ“† See the GitHub contributions calendar of a user in the command line.
JavaScript
190
star
13

git-url-parse

โœŒ๏ธ A high level git url parser for common git providers.
JavaScript
179
star
14

web-term

๐Ÿ“บ A fullscreen terminal in your browser.
JavaScript
165
star
15

emoji.css

๐Ÿ˜‹ Your website. โšก๏ธEmojified. ๐ŸŽ‰ Like FontAwesome for emojis. ๐Ÿš€
HTML
165
star
16

node.cobol

๐Ÿ“Ÿ Node.js bridge for COBOL which allows you to run Node.js code from COBOL.
COBOL
160
star
17

reset-your-facebook-account

๐Ÿ‘ด Some scripts to delete your Facebook posts, comments and likes.
149
star
18

made-in-romania

๐Ÿ‡ท๐Ÿ‡ด A list of cool projects made in Romania.
136
star
19

made-in-brazil

๐Ÿ‡ง๐Ÿ‡ท A list of neat projects made in Brazil.
132
star
20

electronify

๐Ÿ‘ท The simplest way to build Electron apps.
JavaScript
120
star
21

git-stats-importer

๐Ÿ“ˆ Imports your commits from a repository into git-stats history.
JavaScript
109
star
22

emojic

๐Ÿ˜‚ Emoji in your Node.js command line apps.
JavaScript
103
star
23

Flattiance

๐ŸŽจ A semi-flat fork of the Ubuntu Ambiance theme.
CSS
100
star
24

node-fortran

๐Ÿ’€ Fortran bridge for Node.js which allows you to run Fortran code from Node.js.
Fortran
95
star
25

made-in-india

๐Ÿ‡ฎ๐Ÿ‡ณ A list of neat projects made in India.
87
star
26

edit-json-file

Edit a json file with ease.
JavaScript
87
star
27

gif-cli

โญ• Gif animations in your terminal!
JavaScript
87
star
28

git-unsaved

๐Ÿ”Ž Scan your projects directory for dirty git repositories.
JavaScript
84
star
29

nodeice

๐Ÿ’ฐ Another PDF invoice generator
JavaScript
83
star
30

node-gh-polyglot

๐Ÿ’บ Get language stats about GitHub users and repositories.
JavaScript
82
star
31

made-in-turkey

๐Ÿ‡น๐Ÿ‡ท A list of neat projects made in Turkey
77
star
32

birthday

๐ŸŽ‚ Know when a friend's birthday is coming.
JavaScript
74
star
33

blah

๐Ÿ”ฎ A command line tool to optimize the repetitive actions.
EJS
73
star
34

github-labeller

๐Ÿ‡ Automagically create issue labels in your GitHub projects.
JavaScript
73
star
35

terminal-flat-theme

๐ŸŽจ Flat colors for your terminal.
Shell
70
star
36

learning-nodejs

๐Ÿ“– An example-based Node.js tutorial.
JavaScript
67
star
37

text-to-speech-js

โœŒ๏ธ A small JavaScript library that provides a text to speech conversion using tts-api.com service.
JavaScript
66
star
38

anser

๐Ÿ“บ A low level parser for ANSI sequences.
JavaScript
58
star
39

ejs-playground

A web app to play with EJS templates.
CSS
57
star
40

node-ipinfo

๐ŸŒ An http://ipinfo.io NodeJS wrapper.
JavaScript
57
star
41

parse-url

๐Ÿš€ An advanced url parser supporting git urls too.
JavaScript
54
star
42

tinyreq

๐ŸŒŽ Tiny library for making http(s) requests.
JavaScript
54
star
43

image-to-ascii-cli

View images in text format, in your terminal.
JavaScript
49
star
44

node-cli-box

๐Ÿ€ A library to generate ASCII boxes via NodeJS
JavaScript
48
star
45

typpy

โœŒ๏ธ A better typeof for JavaScript.
JavaScript
46
star
46

made-in-russia

๐Ÿ‡ท๐Ÿ‡บ Amazing projects made in Russia.
JavaScript
43
star
47

emoji-dictionary

Convert emoji names in unicode characters and vice versa.
JavaScript
42
star
48

react-todo-app

โœ… A React powered todo app.
JavaScript
42
star
49

img-to-svg

Convert the image pixels in SVG squares.
JavaScript
40
star
50

mdify

๐Ÿ”ฎ Markdown helpers with metadata support.
JavaScript
38
star
51

node-is-there

โŽ A library to check if a file or directory exists in a given path.
JavaScript
38
star
52

mini-lightbox

๐ŸŽƒ Minimalist image lightbox
CSS
37
star
53

namly

๐Ÿ“ฆ A tool for helping you to choose npm package names.
JavaScript
37
star
54

node-cli-pie

๐Ÿ“Š Generate pie charts in terminal and text mode.
JavaScript
37
star
55

node-cli-graph

๐Ÿ“ˆ Easily draw function graphs in text mode.
JavaScript
37
star
56

show-a-license

๐Ÿ“œ A site to provide an easy way to show licenses and their human-readable explanations.
JavaScript
35
star
57

bat

๐Ÿ’ป A minimalist tool for building native desktop applications using WEB technologies.
Shell
35
star
58

cli-gh-cal

๐Ÿ“ˆ GitHub like calendar graphs in command line.
JavaScript
35
star
59

node-cli-frames

โญ• Create ASCII animations in Terminal using ASCII frames.
JavaScript
34
star
60

magnesium

๐Ÿ”ฎ A terminal emulator based on Electron.
HTML
33
star
61

github-colors

๐ŸŽจ GitHub color and file extensions mapping
JavaScript
33
star
62

node.fortran

๐Ÿš€ Execute Node.js in your Fortran programs.
Fortran
33
star
63

tangram

The Tangram Square game in the browser.
JavaScript
33
star
64

gh.js

๐Ÿš€ Tiny GitHub API wrapper for server and client.
JavaScript
32
star
65

made-in-ukraine

๐Ÿ‡บ๐Ÿ‡ฆ Neat projects made in Ukraine.
JavaScript
31
star
66

img-ssim

๐Ÿ—ป Get the structural similarity between two images.
JavaScript
31
star
67

emoji-unicode

๐Ÿ”ฎ Get the unicode code of an emoji.
JavaScript
30
star
68

emoji-name-map

๐Ÿ“ Name to unicode emoji mapping.
JavaScript
30
star
69

regex-parser.js

๐Ÿ˜‘ A module that parses a string as regular expression and returns the parsed value
JavaScript
29
star
70

made-in-bosnia

๐Ÿ‡ง๐Ÿ‡ฆ A list of cool projects made in Bosnia.
28
star
71

console.js

๐Ÿ’ƒ A JavaScript library that overrides the console object bringing its functionality in a DOM element.
JavaScript
28
star
72

node-color-it

๐ŸŽจ Flat colors for your Node.js strings.
JavaScript
27
star
73

made-in-poland

๐Ÿ‡ต๐Ÿ‡ฑ A list of neat projects made in Poland
26
star
74

msdos-editor-vs-theme

๐Ÿ“บ An MS-DOS Editor like theme for Visual Studio Code. It is blue.
25
star
75

gpm

๐Ÿ’บ npm + git = gpm - Install NPM packages and dependencies from git repositories.
JavaScript
24
star
76

flight-tracker

โœˆ๏ธ A flight tracker in your command line.
JavaScript
24
star
77

made-in

Get GitHub projects created by users from a specific location.
JavaScript
24
star
78

test-youtube-api

๐Ÿš€ Test application for Youtube API NodeJS module
JavaScript
24
star
79

le-table

๐Ÿ“‹ Another NodeJS module for creating ASCII tables.
JavaScript
23
star
80

react-weather-app

โ›… A weather app built with React.
CSS
23
star
81

node-ansi-parser

๐Ÿ”ฃ Parse strings containing ANSI style characters.
JavaScript
22
star
82

js-custom-operators

โœŒ๏ธ Create your own operators in JavaScript
JavaScript
22
star
83

image-parser

โšก An image parser that works.
JavaScript
22
star
84

tilda

Tiny module for building comand line tools.
JavaScript
22
star
85

mdy

๐Ÿ‘€ View markdown files in the command line with ANSI styled images.
JavaScript
21
star
86

git-stats-html

Turn git-stats result into HTML output.
HTML
21
star
87

ajs

๐Ÿ”ฎ Asynchronous templating in Node.js
JavaScript
21
star
88

cheerio-req

An http request module sending back a Cheerio object.
JavaScript
21
star
89

msdos-editor

๐Ÿ“บ An MS-DOS like editor in your browser.
JavaScript
21
star
90

webcam-snow

๐Ÿฏ An application that uses the web camera and the hand movements changing the snow direction in the page. Happy New Year! :-)
JavaScript
21
star
91

text-animation

โญ• Create beautiful ASCII text animations using NodeJS.
JavaScript
20
star
92

face-detectify

๐Ÿ˜… Detect faces in images. Without native modules. It uses tracking.js.
JavaScript
20
star
93

parse-path

๐Ÿ”ฎ Parse paths (local paths, urls: ssh/git/etc)
JavaScript
19
star
94

made-in-austria

๐Ÿ‡ฆ๐Ÿ‡น A list of neat projects made in Austria
19
star
95

love-you

๐Ÿ’– "I love you" in different languages.
JavaScript
19
star
96

VimOS

โ™ป๏ธ Desktop environment based on VIM only
Shell
19
star
97

parrot-bot

๐Ÿง A parrot-like bot you can talk with.
JavaScript
18
star
98

text-to-speech

๐Ÿ“’ Using Google Translate unofficial Java API
Java
18
star
99

kindly-license

๐Ÿ‘ค A human readable license for projects created by human-beings.
HTML
18
star
100

code-style

๐Ÿ“– This document contains guides that I defined and follow when building things. โค๏ธ
18
star