Git Product home page Git Product logo

avatar-me's Introduction

Avatar me logo

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

How to use it?

var avatarMe = require('avatar-me')

avatarMe.fetchAvatar('[email protected]', 'jorge', (err, avatar) => {
  if (err) console.log(err)
  console.log(avatar)
})

Configuration? Yes, please!

Basic configuration

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)
})

Cache configuration using Redis. No more extra api calls!

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)
})

Contribute!

๐Ÿ’ฌ Create a new Pull Request

My social networks

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:

Also you can find me on:

avatar-me's People

Contributors

ferreiro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

avatar-me's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.