JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19
  • Score
    100M100P100Q47946F
  • License MIT

Get a Gravatar image

Package Exports

  • get-gravatar

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (get-gravatar) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

get-gravatar Build Status

Get a Gravatar image

Install

$ npm install --save get-gravatar

Usage

const fs = require('fs');
const getGravatar = require('get-gravatar');

getGravatar('sindresorhus@gmail.com', {size: 200}).then(image => {
    fs.writeFileSync('sindre.png', image);

    console.log('Successfully downloaded the Gravatar image');
});

API

getGravatar(email, [options])

Returns a promise for the image as a buffer.

email

Type: string

Email matching a Gravatar profile.

options

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 email didn't match any Gravatar profile.

rating

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

Allowed rating of the image.

  • gravatar-url - Get the URL to a Gravatar image from an email

License

MIT © Sindre Sorhus