Class UserResource

Represents a GitHub user resource with chainable async methods.

Implements PromiseLike<GitHubUser> so it can be awaited directly to fetch user info, while also exposing sub-resource methods.

// Await directly to get user info
const user = await gh.user('octocat');

// Get the user's public repositories
const repos = await gh.user('octocat').repos({ sort: 'updated' });

// Navigate into a specific repository
const prs = await gh.user('octocat').repo('Hello-World').pullRequests();

Implements

Methods

  • Returns a RepositoryResource for a given repository under this user, providing access to all repository sub-resources.

    Parameters

    • name: string

      The repository name

    Returns RepositoryResource

    A chainable repository resource

    const repo    = await gh.user('octocat').repo('Hello-World');
    const content = await gh.user('octocat').repo('Hello-World').raw('README.md');