Constructor
new GitHub(authopt, apiBaseopt)
Create a new GitHub.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
auth |
Requestable.auth
|
<optional> |
the credentials to authenticate to Github. If auth is not provided requests will be made unauthenticated |
|
apiBase |
string
|
<optional> |
https://api.github.com |
the base Github API URL |
Methods
_getFullName(user, repo) → {string}
Computes the full repository name
Parameters:
Name | Type | Description |
---|---|---|
user |
string
|
the username (or the full name) |
repo |
string
|
the repository name, must not be passed if |
Returns:
- Type:
-
string
the repository's full name
getGist(idopt) → {Gist}
Create a new Gist wrapper
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
id |
string
|
<optional> |
the id for the gist, leave undefined when creating a new gist |
Returns:
- Type:
-
Gist
getIssues(user, repo) → {Issue}
Create a new Issue wrapper
Parameters:
Name | Type | Description |
---|---|---|
user |
string
|
the user who owns the repository |
repo |
string
|
the name of the repository |
Returns:
- Type:
-
Issue
getOrganization(organization) → {Organization}
Create a new Organization wrapper
Parameters:
Name | Type | Description |
---|---|---|
organization |
string
|
the name of the organization |
Returns:
- Type:
-
Organization
getProject(id) → {Project}
Create a new Project wrapper
Parameters:
Name | Type | Description |
---|---|---|
id |
string
|
the id of the project |
Returns:
- Type:
-
Project
getRepo(user, repo) → {Repository}
Create a new Repository wrapper
Parameters:
Name | Type | Description |
---|---|---|
user |
string
|
the user who owns the repository |
repo |
string
|
the name of the repository |
Returns:
- Type:
-
Repository
getTeam(teamId) → {team}
create a new Team wrapper
Parameters:
Name | Type | Description |
---|---|---|
teamId |
string
|
the name of the team |
Returns:
- Type:
-
team