Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

avatar-me

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

avatar-me - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

19

lib/AvatarMe.js

@@ -63,5 +63,6 @@ const async = require('async')

const avatarUrl = googleAvatarApi + email + '?alt=json'
request({
method: 'GET',
uri: avatarUrl,
url: avatarUrl,
gzip: true

@@ -83,8 +84,14 @@ }, (e, r, response) => {

fethGravatarImage (email, callback) {
const avatar = gravatar.url(email, { s: '100', r: 'x', d: '404' })
const gravatarUrl = gravatar.url(email, { protocol: 'https', s: '100', r: 'x', d: '404' })
if (avatar.includes('d=404')) {
return callback(new Error('Gravatar not found'), null)
}
callback(null, avatar)
request({
method: 'GET',
url: gravatarUrl,
format: 'json'
}, (e, r, response) => {
if (response === '404 Not Found') {
return callback(null, null)
}
return callback(null, gravatarUrl)
})
}

@@ -91,0 +98,0 @@

{
"name": "avatar-me",
"version": "0.0.3",
"version": "0.0.4",
"description": "Simple node module to retrieves a user avatar given an email or a user name Edit",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc