A Node.js library to interact with the GitHub users API
import * as ghusers from 'ghusers'
const auth = { token: 'your-github-token' }
// get user by login/username
const user = await ghusers.get(auth, 'substack')
console.log(user)
The auth data is compatible with ghauth so you can connect them together:
import ghauth from 'ghauth'
import * as ghusers from 'ghusers'
const auth = await ghauth({
configName: 'user-lookup',
scopes: ['user']
})
const user = await ghusers.get(auth, 'rvagg')
console.log(user)
All methods return Promises.
Get full user data for a given login/username.
See ghauth for an easy way to obtain and cache GitHub authentication tokens. The auth object returned by ghauth is directly compatible with all ghusers methods.
ghusers is Copyright (c) 2014-2025 Rod Vagg @rvagg and licensed under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.