gravatar-url-simple

1.0.12 • Public • Published

Gravatar

npm NPM downloads License

Simple, lightweight npm package without external dependencies

Install

npm i gravatar-url-simple

Import

import { gravatarURL } from "gravatar-url-simple";

Simple usage:

const email = "test@email.com"
const defaultImage = gravatarURL.gravatarTypes.IDENTICON
gravatarURL.getGravatarUrl(email, defaultImage)

Default inage types:

const gravatarTypes = {
  NOTFOUND: "404",
  MP: "mp",
  IDENTICON: "identicon",
  MONSTERID: "monsterid",
  WAVATAR: "wavatar",
  RETRO: "retro",
  ROBOHASH: "robohash",
  BLANK: "blank",
};

404: do not load any image if none is associated with the email hash, instead return an HTTP 404 (File Not Found) response

mp: (mystery-person) a simple, cartoon-style silhouetted outline of a person (does not vary by email hash)

identicon: a geometric pattern based on an email hash

monsterid: a generated 'monster' with different colors, faces, etc

wavatar: generated faces with differing features and backgrounds

retro: awesome generated, 8-bit arcade-style pixelated faces

robohash: a generated robot with different colors, faces, etc

blank: a transparent PNG image (border added to HTML below for demonstration purposes)

Readme

Keywords

none

Package Sidebar

Install

npm i gravatar-url-simple

Weekly Downloads

12

Version

1.0.12

License

MIT

Unpacked Size

18.1 kB

Total Files

4

Last publish

Collaborators

  • kirill_shlemen