Generate GitHub warehouse growth chart and personal data report for your README
The Github Star growth legend is to cycle through the Github API and get the list of Stars in the warehouse. Due to API limitations, we cannot perfectly get all Stars and their corresponding time nodes, so only the legends of projects less than 500 Star are provided. If the number of stars in your project exceeds 500, then the legend will only render the first 500 items. For the time being, the items with more than 500 items are already slightly more mature ones, haha
Copy the following code to your markdown files, you can enjoy your warehouse growth chart the
need to update repo=
your warehouse name, owner=
your user name
![TaroXin Repo Star](http://repo-charts.taroxin.cn/api/repo/starChart?repo=vue-pretty-logger&owner=TaroXin)
In the legend, we use the default ${owner}/${repo}
form as the main title, Star 成长曲线
as the subtitle, you can modify them through mass participation
modifying title=
your main title, subtitle=
as your subtitle
You can also use showTitle=true
or showSubtitle=false
to control the main title and subtitle Hide
![TaroXin Repo Star](http://repo-charts.taroxin.cn/api/repo/starChart ?repo=vue-pretty-logger&owner=TaroXin&title=My-Repo-Star&subtitle= My warehouse growth track)
Forks and Stars have the same reason. Due to the limitation of Github API, we can only get 500 pieces of data.
The following code can generate the Forks growth legend. As you may have noticed, we just added a special parameter from=fork
. The from
parameter is used to distinguish whether the data is from star
or from fork
. If you do not pass this parameter, it will be used star
by default . Other parameters and get Star legend The same interface
![TaroXin Repo Star](http://repo-charts.taroxin.cn/api/repo/starChart?repo=vue-pretty-logger&owner=TaroXin&from=form)
The Legend supports two ways to generate, when owner=
the time is not empty, the user will get the name of the language map all warehouse, if owner=
and repo=
neither is empty, it generates a map of the warehouse language
The color options of the legend come from GitHub, and GitHub has unique color definitions for each language
![TaroXin Language](http://repo-charts.taroxin.cn/api/repo/languageChart?owner=TaroXin)
![TaroXin Repo Language](http://repo-charts.taroxin.cn/api/repo/languageChart?owner=TaroXin&repo=vue-pretty-logger)
If you are interested in participating in this project, or you just want to run it locally, then you only need the following steps to run normally
We need you to clone the project correctly and install related dependencies. It should be noted that the project contains puppeteer related dependencies. If the download fails, please refer to other documents.
git clone https://github.com/TaroXin/github-repo-charts.git
cd github-repo-charts && npm i
New .env
file, this is our private variable files, store personal Github Access Token
and we need as a data cache Redis
configuration, the following configuration is not available, you need to configure their own data
GITHUB_ACCESS_TOKEN=<Your Token>
REDIS_IP=<Redis ip>
REDIS_PORT=<Redis port>
REDIS_PASSWORD=<Redis password>
Run the project and visit
npm run dev
open http://localhost:7001/api/repo/starChart
You will get an 422
error to remind you that the corresponding parameter configuration is missing
Author: TaroXin
Source Code: https://github.com/TaroXin/github-repo-charts
#nodejs #node #javascript