User

User

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

Constructor

new User(usernameopt, authopt, apiBaseopt)

Create a User.

Source:
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

Methods

createRepo(options, cbopt) → {Promise}

Create a new repository for the currently authenticated user

Source:
See:
Parameters:
Name Type Attributes Description
options object

the repository definition

cb Requestable.callback <optional>

will receive the API response

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

follow(username, cbopt) → {Promise}

Have the authenticated user follow this user

Source:
See:
Parameters:
Name Type Attributes Description
username string

the user to follow

cb Requestable.callback <optional>

will receive true if the request succeeds

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

getEmails(cbopt) → {Promise}

List email addresses for a user

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

will receive the list of emails

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

getProfile(cbopt) → {Promise}

Show the user's profile

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

will receive the user's information

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

listFollowers(cbopt) → {Promise}

List followers of a user

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

will receive the list of followers

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

listFollowing(cbopt) → {Promise}

List users followed by another user

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

will receive the list of who a user is following

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

listGists(cbopt) → {Promise}

List the user's gists

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

will receive the list of gists

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

listNotifications(optionsopt, cbopt) → {Promise}

List the user's notifications

Source:
See:
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

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

listOrgs(cbopt) → {Promise}

List the orgs that the user belongs to

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

will receive the list of organizations

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

listRepos(optionsopt, cbopt) → {Promise}

List the user's repositories

Source:
See:
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

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

listStarredGists(optionsopt, cbopt) → {Promise}

Gets the list of starred gists for the user

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

any options to refine the search

cb Requestable.callback <optional>

will receive the list of gists

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

listStarredRepos(cbopt) → {Promise}

Gets the list of starred repositories for the user

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

will receive the list of starred repositories

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

unfollow(username, cbopt) → {Promise}

Have the currently authenticated user unfollow this user

Source:
See:
Parameters:
Name Type Attributes Description
username string

the user to unfollow

cb Requestable.callback <optional>

receives true if the request succeeds

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