
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
github-username
Advanced tools
Get a GitHub username from an email address
npm install github-username
import githubUsername from 'github-username';
console.log(await githubUsername('sindresorhus@gmail.com'));
//=> 'sindresorhus'
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.
Type: string
The email address for the user of whom you want the username.
Type: object
Type: string
GitHub personal access token.
The gh-user package allows you to fetch detailed information about a GitHub user by their username. Unlike github-username, which maps an email to a username, gh-user provides more comprehensive user data such as name, bio, and repositories.
The github-api package is a more general-purpose library for interacting with the GitHub API. It allows you to perform a wide range of actions, including fetching user data, repositories, and issues. While it can be used to get user information, it requires more setup and is not as specialized as github-username.
Octokit is the official GitHub REST API client for JavaScript. It provides a comprehensive set of tools for interacting with GitHub's API, including user data retrieval. However, it is more complex and feature-rich compared to the lightweight and focused github-username package.
FAQs
Get a GitHub username from an email address
We found that github-username demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.