Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including gh-user with all npm packages installed. Try it out:

var ghUser = require("gh-user")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

gh-user v4.0.0

Get user info from a GitHub username

gh-user Build Status

Get user info from a GitHub username

Install

$ npm install gh-user

Usage

const ghUser = require('gh-user');

(async () => {
    console.log(await ghUser('sindresorhus'));
    //=> {login: 'sindresorhus', id: 170270, …}
})();

API

ghUser(username, [options])

username

Type: string

GitHub username.

options

Type: Object

Any gh-got option. To use a GitHub personal access token for example, pass in:

{
    token: 'YOUR-TOKEN'
}

Promise

user

Type: Object

Various user info.

License

MIT © Sindre Sorhus

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free