mirror of
https://github.com/IonicaBizau/git-stats.git
synced 2025-01-08 20:51:55 +01:00
Generated docs
This commit is contained in:
parent
3c0df38cd2
commit
08e70cfd34
1 changed files with 63 additions and 3 deletions
66
README.md
66
README.md
|
@ -125,19 +125,79 @@ Records a new commit.
|
||||||
|
|
||||||
#### Params
|
#### Params
|
||||||
- **Object** `data`: The commit data containing:
|
- **Object** `data`: The commit data containing:
|
||||||
- `date` (String|Date): The date object or a string in this format: `DDD MMM dd HH:mm:ss YYYY`
|
- `date` (String|Date): The date object or a string in a format that can be parsed.
|
||||||
- `url` (String): The repository remote url.
|
- `url` (String): The repository remote url.
|
||||||
- `hash` (String): The commit hash.
|
- `hash` (String): The commit hash.
|
||||||
|
|
||||||
- **Function** `callback`: The callback function.
|
- **Function** `callback`: The callback function.
|
||||||
|
|
||||||
### `get(data, callback)`
|
#### Return
|
||||||
|
- **GitStats** The `GitStats` object.
|
||||||
|
|
||||||
|
### `get(callback)`
|
||||||
Gets the git stats.
|
Gets the git stats.
|
||||||
|
|
||||||
#### Params
|
#### Params
|
||||||
- **Object** `data`: The stats filter. **Not yet implemented**.
|
|
||||||
- **Function** `callback`: The callback function.
|
- **Function** `callback`: The callback function.
|
||||||
|
|
||||||
|
#### Return
|
||||||
|
- **GitStats** The `GitStats` object.
|
||||||
|
|
||||||
|
### `save(stats, callback)`
|
||||||
|
Saves the provided stats.
|
||||||
|
|
||||||
|
#### Params
|
||||||
|
- **Object** `stats`: The stats to be saved.
|
||||||
|
- **Function** `callback`: The callback function.
|
||||||
|
|
||||||
|
#### Return
|
||||||
|
- **GitStats** The `GitStats` object.
|
||||||
|
|
||||||
|
### `iterateDays(data, callback)`
|
||||||
|
Iterate the days, calling the callback function for 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*).
|
||||||
|
- `format` (String): The format of the date (default: `"MMM D, YYYY"`).
|
||||||
|
|
||||||
|
- **Function** `callback`: The callback function called with the current day formatted (type: string) and the `Moment` date object.
|
||||||
|
|
||||||
|
#### Return
|
||||||
|
- **GitStats** The `GitStats` object.
|
||||||
|
|
||||||
|
### `graph(data, callback)`
|
||||||
|
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.
|
||||||
|
|
||||||
|
#### Return
|
||||||
|
- **GitStats** The `GitStats` object.
|
||||||
|
|
||||||
|
### `calendar(data, callback)`
|
||||||
|
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.
|
||||||
|
|
||||||
|
#### Return
|
||||||
|
- **GitStats** The `GitStats` object.
|
||||||
|
|
||||||
|
### `ansiCalendar(data, callback)`
|
||||||
|
Creates the ANSI contributions calendar.
|
||||||
|
|
||||||
|
#### Params
|
||||||
|
- **Object** `data`: The object passed to the `calendar` method.
|
||||||
|
- **Function** `callback`: The callback function.
|
||||||
|
|
||||||
|
#### Return
|
||||||
|
- **GitStats** The `GitStats` object.
|
||||||
|
|
||||||
|
|
||||||
## How to contribute
|
## How to contribute
|
||||||
|
|
||||||
1. File an issue in the repository, using the bug tracker, describing the
|
1. File an issue in the repository, using the bug tracker, describing the
|
||||||
|
|
Loading…
Reference in a new issue