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

Package detail

github-username

sindresorhus3.4mMIT9.0.0TypeScript support: included

Get a GitHub username from an email address

github, user, username, email, address, gh, git

readme

github-username

Get a GitHub username from an email address

Install

npm install github-username

Usage

import githubUsername from 'github-username';

console.log(await githubUsername('sindresorhus@gmail.com'));
//=> 'sindresorhus'

API

githubUsername(email, options?)

Get the GitHub username from an email address if the email can be found in any commits on GitHub.

Returns a Promise<string?> with the username.

email

Type: string

The email address for the user of whom you want the username.

options

Type: object

token

Type: string

GitHub personal access token.