1.1.1 • Published 4 years ago

@gravatar/js v1.1.1

Weekly downloads
9
License
MIT
Repository
github
Last release
4 years ago

Gravatar

Typescript friendly Gravatar library to generate gravatar image links from email.

Minimal Dependency: No node or browser dependency, so will work seamlessly in node, browser or electron .

Installation

yarn add @gravatar/js

or

npm i @gravatar/js --save

Parameters

ParamTypeDefaultDescription
emailstringnoneEmail address of the user to generate gravatar
md5HashstringOptional: MD5 hash of the email, either email or MD5 hash is required
sizenumber80Optional: The size of the image to be displayed. Should be from 1 to 2048
defaultImageany of '404', 'mp', 'identicon' , 'monsterid' , 'wavatar' , 'retro', 'robohash', 'blank';
protocolhttp or httpshttpProtocol for the gravatar image url.

Usage

Import

import the library

ES5

const Gravatar = require('@gravatar/js')

ES6

import JsGravatar from '@gravatar/js'

Call the method with its options.

const userProfilePic = Gravatar({ email: 'example@example.com' })

const userProfilePic = Gravatar({ email: 'example@example.com', size: 10, protocol: 'https' })

License

Copyright © 2020 Vazra, MIT License