npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

get-github-usernames

v0.0.2

Published

Determine GitHub usernames from email addresses, even if they are hidden

Downloads

3

Readme

This is a tool to extract GitHub usernames from a known set of email addresses. It works even if the users' emails are not public.

The problem

It doesn't seem to be possible, either using the advanced search features, or the API, to directly look up a github username by a known email address, if that user has chosen not to make that email address public.

But, if they've associated it with their account, even if they haven't made it public, then git commits that they've made to repositories, that use that email address, are linked to their user accounts. And, as it happens, when you access the commits of that repo with the API, the usernames show up there, too.

So this tool works by creating a dummy repo, with git commits that use the email address that you have in your list. You can then push that repo up to GitHub, access the API to scrape the usernames, and then, if you want, delete the repo. So far, this isn't completely automated, but there's no reason it couldn't be.

Using get-github-usernames

Put the email addresses you want into a file named `users.txt, and then run ./index.js.

This creates a dummy git repository, and then makes a commit in it for each of the email addresses in the list.

When it's done (the following steps are manual so far):

  • push the dummy-repo up to GitHub; e.g. klortho/dummy-repo,
  • Access the GitHub API to get the usernames; e.g. https://api.github.com/repos/klortho/dummy-repo/commits
  • If there is a user that has that email address, then the username will be in the author/login field for that commit. Cross-reference to the email in the commit/author/email field.

To do

  • It shouldn't wipe out the dummy repo every time; it should first check it to see which emails already have commits, and then only add commits for those that don't.

  • Automate:

    • Pushing the repo to github (take the github repo url as a command-line param, or in a config file).
    • Reading the commits from the API and producing the report

License

See LICENSE.txt.