gh-avatar

Get the avatar of a GitHub user

Usage no npm install needed!

<script type="module">
  import ghAvatar from 'https://cdn.skypack.dev/gh-avatar';
</script>

README

gh-avatar Build Status

Get the avatar of a GitHub user

Install

$ npm install --save gh-avatar

Usage

const ghAvatar = require('gh-avatar');

ghAvatar('sindresorhus').then(avatar => {
    console.log(avatar);
    //=> 'https://avatars.githubusercontent.com/u/170270?v=3'
});

API

ghAvatar(username, [token], callback)

Returns a promise for a URL to the avatar.

username

Type: string

GitHub username.

token

Type: string

GitHub personal access token.

License

MIT © Sindre Sorhus