0.3.1 • Published 2 years ago
gitflows-stats v0.3.1
Git stats
Provide MR/PR statistics for your Gitlab/GitHub projects
Install
Run npm install -g gitflows-stats
Prerequisite
Generate a token to use the API:
Usage
gitflows-stats --helpwill print:Usage: index [options] [command] Options: -h, --help display help for command Commands: gitlab [options] <token> <projectId> <period> Provide merge requests statistics on a Gitlab project for a given period github [options] <token> <owner> <repo> <period> Provide pull requests statistics on a GitHub project for a given period help [command] display help for commandthe
<period>parameter has an optional end and may be in the following format:2023-01-01,2023-01-31will retrieve all the merged events between these 2 dates2023-01-01will retrieve all the merged events between the given date and now
gitflows-stats gitlab <TOKEN> <PROJECT_ID> <PERIOD>( in the following format2023-01-01,2023-01-31) will print:{ "average": { "months": 0, "days": 4, "hours": 22, "minutes": 48, "seconds": 0 }, "total": { "merged": 15, "closed": 2, "opened": 3, "all": 20 }, "data": [ [ 2023, [ { "Week 9": 1 }, { "Week 10": 5 }, { "Week 11": 3 }, { "Week 12": 2 }, { "Week 13": 2 }, { "Week 14": 2 } ] ] ] }gitflows-stats gitlab <TOKEN> <PROJECT_ID> <PERIOD> --format html( in the following format2023-01-01,2023-01-31) will generate areportfolder with anindex.htmlwhere the command has been executed.The report will automatically open after generation.
example:

Available output format
- Console (Default): print a lightweight statistics in JSON into the console
- HTML: generates a
HTMLfile, opening automatically in your browser - CSV: generates a
CSVfile with all raws data