# github-avatar-url

> Get github's avatar URL either by `username` or `email`.

Latest version **2.0.1** (published 2026-10-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install github-avatar-url
pnpm add github-avatar-url
yarn add github-avatar-url
bun add github-avatar-url
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2026-10-06 |
| First published | 2015-07-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4 |
| Dependencies | 3 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Hemanth.HM |
| Maintainers | hemanth |
| Keywords | github, username, email, gravatar, avatar |

## Links

- npm: https://www.npmjs.com/package/github-avatar-url
- Repository: https://github.com/hemanth/github-avatar-url
- Homepage: https://github.com/hemanth/github-avatar-url#readme
- Issues: https://github.com/hemanth/github-avatar-url/issues
- npm.io page: https://npm.io/package/github-avatar-url

## Dependencies (3)

- [gh-got](https://npm.io/package/gh-got.md) ^12.0.0
- [email-regex](https://npm.io/package/email-regex.md) ^6.1.0
- [github-username](https://npm.io/package/github-username.md) ^9.0.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2026-10-06
- 2.0.0 — 2017-04-03
- 1.0.0 — 2015-07-29

## README

# github-avatar-url [![Build Status](https://travis-ci.org/hemanth/github-avatar-url.svg?branch=master)](https://travis-ci.org/hemanth/github-avatar-url)

> Get github's avatar URL either by `username` or `email`.


## Install

```
$ npm install --save github-avatar-url
```


## Usage

```js
var githubAvatarUrl = require('github-avatar-url');

githubAvatarUrl('hemanth', {token:'foo'})
.then(console.log)
.catch(console.error)

githubAvatarUrl('hemanth.hm@gmail.com', {token:'foo'})
.then(console.log)
.catch(console.error)
```


## API

### githubAvatarUrl(input, [token])

#### input

*Required*  
Type: `string`

Either `email` or `username`

### token

Type: `string`

GitHub [access token](https://github.com/settings/tokens/new).

Can be overriden globally with the `GITHUB_TOKEN` environment variable.


## License

MIT © [Hemanth.HM](http://h3manth.com)

---
_Source: https://npm.io/package/github-avatar-url · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
