Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
github-username
Advanced tools
The github-username npm package is a simple utility that allows you to retrieve a GitHub username from an email address. This can be particularly useful for applications that need to map email addresses to GitHub profiles.
Retrieve GitHub Username
This feature allows you to retrieve the GitHub username associated with a given email address. The code sample demonstrates how to use the package to get the username asynchronously.
const githubUsername = require('github-username');
(async () => {
const username = await githubUsername('email@example.com');
console.log(username);
})();
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.
Get a GitHub username from an email address
$ npm install github-username
const githubUsername = require('github-username');
githubUsername('sindresorhus@gmail.com').then(username => {
console.log(username);
//=> 'sindresorhus'
});
Returns a Promise
for the username.
Type: string
Email address for the user of whom you want the username.
Type: string
GitHub personal access token.
MIT © Sindre Sorhus
FAQs
Get a GitHub username from an email address
The npm package github-username receives a total of 499,411 weekly downloads. As such, github-username popularity was classified as popular.
We found that github-username demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.