mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2024-12-22 05:12:11 +01:00
Updated docs
This commit is contained in:
parent
e67e4ad96d
commit
66d63af1ad
3 changed files with 24 additions and 2 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -3,3 +3,6 @@
|
|||
*~
|
||||
*.log
|
||||
node_modules
|
||||
*.env
|
||||
.DS_Store
|
||||
package-lock.json
|
||||
|
|
|
@ -5,6 +5,7 @@ You can see below the API reference of this module.
|
|||
### `GitStats(dataPath)`
|
||||
|
||||
#### Params
|
||||
|
||||
- **String** `dataPath`: Path to the data file.
|
||||
|
||||
#### Return
|
||||
|
@ -14,6 +15,7 @@ You can see below the API reference of this module.
|
|||
Fetches the configuration object from file (`~/.git-stats-config.js`).
|
||||
|
||||
#### Params
|
||||
|
||||
- **Function** `callback`: The callback function.
|
||||
|
||||
#### Return
|
||||
|
@ -23,6 +25,7 @@ Fetches the configuration object from file (`~/.git-stats-config.js`).
|
|||
Inits the configuration field (`this.config`).
|
||||
|
||||
#### Params
|
||||
|
||||
- **Object|String** `input`: The path to a custom git-stats configuration file or the configuration object.
|
||||
- **Function** `callback`: The callback function.
|
||||
|
||||
|
@ -30,6 +33,7 @@ Inits the configuration field (`this.config`).
|
|||
Records a new commit.
|
||||
|
||||
#### Params
|
||||
|
||||
- **Object** `data`: The commit data containing:
|
||||
- `date` (String|Date): The date object or a string in a format that can be parsed.
|
||||
- `url` (String): The repository remote url.
|
||||
|
@ -46,6 +50,7 @@ removeCommit
|
|||
Deletes a specifc commit from the history.
|
||||
|
||||
#### Params
|
||||
|
||||
- **Object** `data`: The commit data containing:
|
||||
- `date` (String|Date): The date object or a string in a format that can be parsed. If not provided, the hash object will be searched in all dates.
|
||||
- `hash` (String): The commit hash.
|
||||
|
@ -60,6 +65,7 @@ Deletes a specifc commit from the history.
|
|||
Gets the git stats.
|
||||
|
||||
#### Params
|
||||
|
||||
- **Function** `callback`: The callback function.
|
||||
|
||||
#### Return
|
||||
|
@ -69,6 +75,7 @@ Gets the git stats.
|
|||
Saves the provided stats.
|
||||
|
||||
#### Params
|
||||
|
||||
- **Object** `stats`: The stats to be saved.
|
||||
- **Function** `callback`: The callback function.
|
||||
|
||||
|
@ -79,6 +86,7 @@ Saves the provided stats.
|
|||
Iterate through the days, calling the callback function on each day.
|
||||
|
||||
#### Params
|
||||
|
||||
- **Object** `data`: An object containing the following fields:
|
||||
- `start` (Moment): A `Moment` date object representing the start date (default: *an year ago*).
|
||||
- `end` (Moment): A `Moment` date object representing the end date (default: *now*).
|
||||
|
@ -92,6 +100,7 @@ Iterate through the days, calling the callback function on each day.
|
|||
Creates an object with the stats on the provided period (default: *last year*).
|
||||
|
||||
#### Params
|
||||
|
||||
- **Object** `data`: The object passed to the `iterateDays` method.
|
||||
- **Function** `callback`: The callback function.
|
||||
|
||||
|
@ -102,6 +111,7 @@ Creates an object with the stats on the provided period (default: *last year*).
|
|||
Creates the calendar data for the provided period (default: *last year*).
|
||||
|
||||
#### Params
|
||||
|
||||
- **Object** `data`: The object passed to the `graph` method.
|
||||
- **Function** `callback`: The callback function.
|
||||
|
||||
|
@ -112,6 +122,7 @@ Creates the calendar data for the provided period (default: *last year*).
|
|||
Creates the ANSI contributions calendar.
|
||||
|
||||
#### Params
|
||||
|
||||
- **Object** `options`: The object passed to the `calendar` method.
|
||||
- **Function** `callback`: The callback function.
|
||||
|
||||
|
@ -122,6 +133,7 @@ Creates the ANSI contributions calendar.
|
|||
Creates an array with the authors of a git repository.
|
||||
|
||||
#### Params
|
||||
|
||||
- **String|Object** `options`: The repo path or an object containing the following fields:
|
||||
- `repo` (String): The repository path.
|
||||
- **Function** `callback`: The callback function.
|
||||
|
@ -133,6 +145,7 @@ Creates an array with the authors of a git repository.
|
|||
Creates the authors pie.
|
||||
|
||||
#### Params
|
||||
|
||||
- **String|Object** `options`: The repo path or an object containing the following fields:
|
||||
- `repo` (String): The repository path.
|
||||
- `radius` (Number): The pie radius.
|
||||
|
@ -147,6 +160,7 @@ Creates the authors pie.
|
|||
Creates the global contributions calendar (all commits made by all committers).
|
||||
|
||||
#### Params
|
||||
|
||||
- **String|Object** `options`: The repo path or an object containing the following fields:
|
||||
- `repo` (String): The repository path.
|
||||
- `start` (String): The start date.
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
|
||||
|
||||
|
||||
[![git-stats](http://i.imgur.com/Q7TQYHx.png)](#)
|
||||
|
||||
# `$ git-stats`
|
||||
|
||||
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Version](https://img.shields.io/npm/v/git-stats.svg)](https://www.npmjs.com/package/git-stats) [![Downloads](https://img.shields.io/npm/dt/git-stats.svg)](https://www.npmjs.com/package/git-stats)
|
||||
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/git-stats.svg)](https://www.npmjs.com/package/git-stats) [![Downloads](https://img.shields.io/npm/dt/git-stats.svg)](https://www.npmjs.com/package/git-stats)
|
||||
|
||||
> Local git statistics including GitHub-like contributions calendars.
|
||||
|
||||
|
@ -230,13 +232,15 @@ g1.ansiCalendar({
|
|||
});
|
||||
```
|
||||
|
||||
|
||||
|
||||
## :question: Get Help
|
||||
|
||||
There are few ways to get help:
|
||||
|
||||
1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). 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. :bug:
|
||||
3. For direct and quick help from me, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
|
||||
3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
|
||||
|
||||
|
||||
## :memo: Documentation
|
||||
|
@ -260,6 +264,7 @@ this takes time. You can integrate and use these projects in your applications *
|
|||
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 :rocket:
|
||||
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
|
||||
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
|
||||
- [![Support me on Patreon][badge_patreon]][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`
|
||||
|
|
Loading…
Reference in a new issue