Detect whether or not a README document exists at the root of a GitHub or GitHub Enterprise repository. If a README exists, evaluate the README for quality and provide a numerical score from 0 to 100, where 0 is the lowest quality and 100 is the highest.
Properties:
Name | Type | Description |
---|---|---|
api |
external:Octokit
|
A GitHubAPI (@octokit/rest) instance. |
ReadmeAppraisal |
ReadmeAppraisal
|
An API proxy/wrapper that invokes the readme-score-api in order to assess and grade the quality of a README file. |
Methods
(static) authenticate(credentials) → {void}
Sets GitHub credentials for all subsequent requests.
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
credentials |
object
|
Secret strings used to prove identity.
|
Returns:
- Type:
-
void
(static) check(params) → {Promise.<ReadmeInfo>}
Attempts to GET a README at the root of a GitHub (or GitHub Enterprise) repository and, if found, rate its quality with the readme-score-api.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object
|
The owner/org, repo, and (optional) branch to check.
|
Returns:
- Type:
-
Promise.<ReadmeInfo>
(static) getAppraisal(url) → {Promise.<AppraisalData>}
An API proxy for the readme-score-api, which provides quality
measures for README files with the AppraisalData
interface.
Parameters:
Name | Type | Description |
---|---|---|
url |
string
|
The URL or slug of a repository. |
Returns:
- Type:
-
Promise.<AppraisalData>
(static) getInfo(params) → {Promise.<ReadmeInfo>}
Attempts to GET a remote README at the root of a GitHub
(or GitHub Enterprise) repository, but with an {AppraisalData}
NullObject
.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object
|
The owner/org, repo, and (optional) branch to check.
|
Returns:
- Type:
-
Promise.<ReadmeInfo>