
Product
Introducing Custom Tabs for Org Alerts
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.
get-gravatar
Advanced tools
Get a Gravatar image from an identifier, such as an email
$ npm install get-gravatar
import fs from 'node:fs/promises';
import getGravatar from 'get-gravatar';
const image = await getGravatar('sindresorhus@gmail.com', {size: 200});
await fs.writeFile('sindre.png', image);
console.log('Successfully downloaded the Gravatar image');
Returns a promise for the image as a Buffer.
Type: string
The identifier for which to get the Gravatar image.
This will typically be an email matching a Gravatar profile, but can technically be any string.
The Gravatar service only sees a hash of the identifier, so you could actually use this to get pseudo-random avatars for any entity, e.g. based on its ID.
Note that if the identifier contains an @, it is assumed to be an email, and will therefore be lower-cased and trimmed before hashing, as per the Gravatar instructions - otherwise it will be hashed as-is.
Type: object
Type: number
Default: 80
Values: 1..2048
The size of the image.
Type: string
Default: This image
Values: Custom URL or 404, mm, identicon, monsterid, wavatar, retro, blank
The image to return if the identifier didn't match any Gravatar profile.
Type: string
Default: 'g'
Values: 'g' | 'pg' | 'r' | 'x'
The allowed rating of the image.
FAQs
Get a Gravatar image from an identifier, such as an email
We found that get-gravatar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Create and share saved alert views with custom tabs on the org alerts page, making it easier for teams to return to consistent, named filter sets.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.