Global

Methods

(async) getAuthors(configs) → {Promise.<Array.<Array.<string>>>}

Source:
Get the GitHub usernames of the authors to the given paths.
Parameters:
Name Type Description
configs Object
Properties
Name Type Attributes Default Description
repo string The GitHub repository, in the "owner/name" format.
paths string | Array.<string> <optional>
[] The paths containing the files for which you want to get the authors.
cache Map.<string, string> <optional>
new Map() The cache. The emails of the authors of [filePath] will be added in the cache.
token string | null <optional>
process.env.GITHUB_TOKEN A GitHub Personal Access Token, or null if you don't want to use tokens.
follow boolean <optional>
true Whether to use the "--follow" option of "git log" or not. i.e. Continue listing the history of a file beyond renames. WARNING: In order to make this option work, you need to list ALL files in [paths], not only the directories containing the files.
usersNoreply boolean <optional>
true Use the regular expression to get the username for /^\d+\+([A-Za-z0-9_.-]+)@users.noreply.github.com$/.
apiConcurrency number <optional>
64 Maximum number of API requests at the same time.
gitConcurrency number <optional>
32 Maximum number of Git processes at the same time.
onerror OnErrorCallback <optional>
console.error(...) The callback function when error happens.
git string <optional>
'git' The command (path to the binary file) for Git.
Returns:
An array of the authors to each file.
Type
Promise.<Array.<Array.<string>>>

newCache() → {Map.<string, string>}

Source:
Get an empty cache
Returns:
An empty cache
Type
Map.<string, string>

(async) readCache(cachePath) → {Promise.<Map.<string, string>>}

Source:
Read from a cache file.
Parameters:
Name Type Description
cachePath string The path to the cache file.
Returns:
The cache.
Type
Promise.<Map.<string, string>>

(async) writeCache(cache, cachePath)

Source:
Write cache to a cache file.
Parameters:
Name Type Description
cache Map.<string, string> The cache.
cachePath string The path to the cache file.

Type Definitions

OnErrorCallback(shaopt, emailopt, erroropt)

Source:
Parameters:
Name Type Attributes Description
sha string <optional>
The sha of the commit which caused the error.
email string <optional>
The email of the author to the commit which caused the error.
error any <optional>
The error.