Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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
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.
FAQs
Get a GitHub username from an email address
The npm package github-username receives a total of 777,164 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.