Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gravatar-url

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gravatar-url

Get the URL to a Gravatar image from an identifier, such as an email

  • 4.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
23K
increased by13.62%
Maintainers
1
Weekly downloads
 
Created
Source

gravatar-url

Get the URL to a Gravatar image from an identifier, such as an email

Install

$ npm install gravatar-url

Usage

import gravatarUrl from 'gravatar-url';

gravatarUrl('sindresorhus@gmail.com', {size: 200});
//=> 'https://gravatar.com/avatar/d36a92237c75c5337c17b60d90686bf9?size=200'

API

gravatarUrl(identifier, options?)

identifier

Type: string

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.

options

Type: object

size

Type: number
Default: 80
Values: 1..2048

Size of the image.

default

Type: string
Default: This image
Values: Custom URL or 404, mm, identicon, monsterid, wavatar, retro, blank

Image to return if the identifier didn't match any Gravatar profile.

rating

Type: string
Default: g
Values: g pg r x

Allowed rating of the image.

  • get-gravatar - Get a Gravatar image

Keywords

FAQs

Package last updated on 03 Jun 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc