
Brightly decorate your GitHub Graph
Impress viewers with just 40 lines of code
I. Motivation
In the past I was searching for good libraries of npm and I stumbled upon a library called simple-git. This is a library that runs git commands on nodejs. And then I immediately thought of the contributions chart on github, is there a way to make this chart green? And so this article was born.
II. Setup
1. Initial Nodejs project and install dependencies
2. Fake data
Create a file named data.json
at the root of the project to store changes when committing new code.
3. Insert script
Create a javascript file name index.js
with the following content at the root of the project.
4. Action
Initialize the git repo (if empty), skip this step if you already have a git repo.
Run the script to create commit.
Finally, push code to remote then enjoy the result.
š Related posts
Want to update?
Subscribe to my blog to receive the latest updates from us.