Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

gh-user

sindresorhus60MIT6.0.0TypeScript support: included

Get user info from a GitHub username

github, gh, user, username, info, api

readme

gh-user

Get user info from a GitHub username

Install

npm install gh-user

Usage

import ghUser from 'gh-user';

console.log(await ghUser('sindresorhus'));
//=> {login: 'sindresorhus', id: 170270, …}

API

ghUser(username, options?)

Returns a Promise<object> with various user info.

username

Type: string

GitHub username.

options

Type: object

Any Octokit options.

To use a GitHub personal access token, for example, pass in:

{
    token: 'YOUR-TOKEN'
}