1.5.0 • Published 7 years ago

gravatar-api v1.5.0

Weekly downloads
701
License
MIT
Repository
github
Last release
7 years ago

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: 'test@gmail.com'
}
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: 'test@gmail.com',
    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: 'test@gmail.com',
    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: 'test@gmail.com',
    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
1.5.0

7 years ago

1.4.0

8 years ago

1.3.4

8 years ago

1.3.3

8 years ago

1.3.2

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.5

9 years ago

1.2.4

9 years ago

1.2.3

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.9

9 years ago

1.1.8

9 years ago

1.1.7

9 years ago

1.1.6

9 years ago

1.1.5

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago