Simple node module to retrieves a user avatar given an email or a user name from Google, gravatar or a default image.
Changelog: Change all the changes to this project here
var avatarMe = require('avatar-me')
avatarMe.fetchAvatar('[email protected]', 'jorge', (err, avatar) => {
if (err) console.log(err)
console.log(avatar)
})
var avatarMe = require('avatar-me')
avatarMe.configure({
defaultAvatar: 'mySuperAwesomeDefaultAvatar.png',
defaultAvatarPath: 'http://my/super/awesome/path/to/default/images/'
})
avatarMe.fetchAvatar('[email protected]', 'jorge', (err, avatar) => {
if (err) console.log(err)
console.log(avatar)
})
In 0.1.0 we have introduced support for caching API calls using Redis!
If you wanna use this feature, just add redis to the avatar me config and it will create a new redis client.
var avatarMe = require('./index.js')
avatarMe.configure({
defaultAvatar: 'mySuperAwesomeDefaultAvatar.png',
defaultAvatarPath: 'http://my/super/awesome/path/to/default/images/',
cache: {
host: '127.0.0.1',
port: '6379'
},
shouldFetchGmail: false,
shouldFetchGravatar: false
})
avatarMe.fetchAvatar('[email protected]', 'jorge', (err, avatar) => {
console.log(err)
console.log(avatar)
})
💬 Create a new Pull Request
If you have some doubts or want to stay in touch I'll be happy to help you out or collaborate on new projects. You can reach me here:
- Twitter: https://www.twitter.com/jgferreiro
- Linkedin: https://www.linkedin.com/in/jgferreiro/
- Instagram: https://www.instagram.com/jgferreiro/
Also you can find me on:
- Website: Jorge Ferreiro >
- Contact: Contact form and email >