npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

ghusers

1.0.0

@GitHub Actions

npmHomeRepoSnykSocket
Downloads:20
$ npm install ghusers
DailyWeeklyMonthlyYearly

ghusers

A Node.js library to interact with the GitHub users API

NPM

Requirements

  • Node.js >= 20

Example usage

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)

API

All methods return Promises.

ghusers.get(auth, user, options)

Get full user data for a given login/username.

Authentication

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.

See also

  • ghissues - interact with the GitHub issues API
  • ghpulls - interact with the GitHub pull requests API
  • ghteams - interact with the GitHub teams API
  • ghrepos - interact with the GitHub repos API
  • ghauth - GitHub authentication

License

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.