Return a URL to a random avatar from Gravatar.
$ npm install --save random-avatar
For more use-cases see the tests
var randomAvatar = require('random-avatar');
// API
// - randomAvatar(options)
// options
// - protocol
// - email
// - extension
// - size
// - rating
// - fallback
randomAvatar()
=> '//www.gravatar.com/avatar/41f84bab4a852971eb1d26a287acb763'
By default, a url is returned without a protocol. Specify one to get a random url but with a known protocol:
randomAvatar({protocol: 'https'});
// => https://www.gravatar.com/avatar/f40260c4058cc904b7db652c26099966
Optionally specify a file extension to get one of a known type:
randomAvatar({extension: 'jpg'});
// => //www.gravatar.com/avatar/76697df5874c854e3cc8fde1200b4298.jpg
You can also use it with a known email address to just get that gravatar.
However, note this, of course, no longer makes it random, just more of a helper function:
randomAvatar({email: 'mail@victorquinn.com'});
// => //www.gravatar.com/avatar/8595c2591b0bca22e736813af33fa7c3
- random-tld - Return a random tld(Top Level Domain).
- random-domains - Return a random domain.
- random-email - Return a random email.
- random-protocol - Return a random protocol.
- random-hashtag - Return a random hashtag.
- random-uri - Return a random url.
- random-ipv4 - Return a random ipv4 address.
- random-ipv6 - Return a random ipv6 address.
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.