User

User

A User allows scoping of API requests to a particular Github user.

Constructor

new User(usernameopt, authopt, apiBaseopt)

Create a User.

Parameters:
Name Type Attributes Default Description
username string <optional>

the user to use for user-scoped queries

auth Requestable.auth <optional>

information required to authenticate to Github

apiBase string <optional>
https://api.github.com

the base Github API URL

Source:

Methods

createRepo(options, cbopt) → {Promise}

Create a new repository for the currently authenticated user

Parameters:
Name Type Attributes Description
options object

the repository definition

cb Requestable.callback <optional>

will receive the API response

Source:
See:
Returns:
  • the promise for the http request
Type
Promise

follow(username, cbopt) → {Promise}

Have the authenticated user follow this user

Parameters:
Name Type Attributes Description
username string

the user to follow

cb Requestable.callback <optional>

will receive true if the request succeeds

Source:
See:
Returns:
  • the promise for the http request
Type
Promise

getGists(cbopt) → {Promise}

List the user's gists

Parameters:
Name Type Attributes Description
cb Requestable.callback <optional>

will receive the list of gists

Source:
See:
Returns:
  • the promise for the http request
Type
Promise

getNotifications(optionsopt, cbopt) → {Promise}

List the user's notifications

Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

any options to refine the search

cb Requestable.callback <optional>

will receive the list of repositories

Source:
See:
Returns:
  • the promise for the http request
Type
Promise

getOrgs(cbopt) → {Promise}

List the orgs that the user belongs to

Parameters:
Name Type Attributes Description
cb Requestable.callback <optional>

will receive the list of organizations

Source:
See:
Returns:
  • the promise for the http request
Type
Promise

getProfile(cbopt) → {Promise}

Show the user's profile

Parameters:
Name Type Attributes Description
cb Requestable.callback <optional>

will receive the user's information

Source:
See:
Returns:
  • the promise for the http request
Type
Promise

getRepos(optionsopt, cbopt) → {Promise}

List the user's repositories

Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

any options to refine the search

cb Requestable.callback <optional>

will receive the list of repositories

Source:
See:
Returns:
  • the promise for the http request
Type
Promise

getStarredRepos(cbopt) → {Promise}

Gets the list of starred repositories for the user

Parameters:
Name Type Attributes Description
cb Requestable.callback <optional>

will receive the list of starred repositories

Source:
See:
Returns:
  • the promise for the http request
Type
Promise

unfollow(username, cbopt) → {Promise}

Have the currently authenticated user unfollow this user

Parameters:
Name Type Attributes Description
username string

the user to unfollow

cb Requestable.callback <optional>

receives true if the request succeeds

Source:
See:
Returns:
  • the promise for the http request
Type
Promise