1. gravatar-api
module to build image and profile urls for gravatar
gravatar-api
Package: gravatar-api
Created by: lwhiteley
Last modified: Sat, 18 Jun 2022 14:03:52 GMT
Version: 1.5.0
License: MIT
Downloads: 1,783
Repository: https://github.com/lwhiteley/gravatar-api

Install

npm install gravatar-api
yarn add gravatar-api

gravatar-api

Build Status
Dependencies

Node module to build image and profile urls for gravatar.

gravatar-api makes it easy to build gravatar image and profile urls.

To Install

Using node package manager

Example

 npm install --save gravatar-api

To Use

Simply add the following require statement to import the module and then call the imageUrl method with the relevant options.

Example

 var gravatar = require('gravatar-api');
var options = {
    email: '[email protected]'
}
var avatar = gravatar.imageUrl(options);

You can also specify the size of the image with the following (or any valid gravatar image option)

Example

 var options = {
    email: '[email protected]',
    parameters: { "size": "200" }
}
var avatar = gravatar.imageUrl(options);

A valid size is between 1 - 2048.

For more options, see gravatar documentation

Secure Endpoint

You can specify retrieving the secure version of the URL by setting the secure property to true

Example

 var options = {
    email: '[email protected]',
    parameters: { "size": "200", "d": "mm" },
    secure: true
}
var avatar = gravatar.imageUrl(options);

Gravatar Profile URLs

You can retrieve a user's gravatar profile url.

see the gravatar docs for more information on what parameters can be used
for each type.

Example

 var options = {
    email: '[email protected]',
    type: 'json', // Default: json,
                  // Available Types: 'json', 'xml', 'qr', 'php', 'vcf'
    parameters: {'callback': 'doSomething' }, //optional
    secure: true
}
var gravatarProfileUrl = gravatar.getProfileUrl(options);

Notes

  • All values in parameters will be url encoded
  • compatible with react-native

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin