🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gravatar/js

Typescript friendly, email to gravatar generator which works seamlesly in Node, Browser and in Electron

1.1.1
latest
Version published
Weekly downloads
949
-9.62%
Maintainers
1
Weekly downloads
 
Created

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

FAQs

Package last updated on 28 Jul 2020

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