package
Verify the current GitHub user via their private keys
npm install github-current-userGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Get the current GitHub user and verify that they have access to a private key that's been authorized to that account.
Uses the username in user.username or github.user or the email address in
user.email of the user's .gitconfig and the private keys in in the user's
ssh-agent with fallback to ~/.ssh/id_rsa or ~/.ssh/id_dsa.
If the username is known, you can use verifyUser and pass it as the first
argument which bypasses .gitconfig lookup work.
var user = require('github-current-user');
user.verify(function (err, verified, username) {
// if verified === true, the user has the correct private key or ssh-agent
// for the username in the `username`
console.log(verified, username);
});var user = require('github-current-user');
user.verifyUser('beaugunderson', function (err, verified, username) {
// if verified === true, the user has the correct private key or ssh-agent
// for the username in the `username`
console.log(verified, username);
});$ npm i github-current-user -g
$ github-current-user
You are verified as maxogden
$ github-current-user maxogden
You are verified as maxogdenmaxogden
max@maxogden.com
Estimated unpacked size across 54 packages.
7.8 MB
Includes dependencies.
6 direct · 5 outdated
^2.1.3
4.4.3
^1.2.2
3.0.7
^2.55.0
2.88.2
^0.1.0
2.0.0
^1.1.1
9.0.0
^0.3.1
3.0.0