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

network-avatar-picker

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

network-avatar-picker

A picker for user's networks profile image.

  • 1.3.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

network-avatar-picker

A npm module that returns as buffer a user's social network profile picture. This way, you can handle buffers and store them as images in your DB. You can choose among twitter, instagram, tumblr, vimeo and facebook and just send a username.

Supported Providers

  • facebook
  • github
  • instagram
  • tumblr
  • twitter
  • vimeo

Usage

First, install network-avatar-picker as a dependency:

npm install --save network-avatar-picker

Then you should require in order to be able use it:

const AvatarPickerService = require('network-avatar-picker');
const avatarPicker = new AvatarPickerService();

Use the methods of the avatarPicker class to get user avatars from networks:

  • avatarPicker.twitter.getAvatar(username)
  • avatarPicker.instagram.getAvatar(username)
  • avatarPicker.tumblr.getAvatar(username)
  • avatarPicker.vimeo.getAvatar(username)
  • avatarPicker.facebook.getAvatar(username)
  • avatarPicker.github.getAvatar(username)

Example

  1. This way you will retrieve twitter's cnn account profile picture as buffer
const AvatarPickerService = require('network-avatar-picker');
const avatarPicker = new AvatarPickerService();
(async () => {
    try {
      const buffer = await avatarPicker.twitter.getAvatar('cnn');
    } catch (e) {
      // Deal with the fact the chain failed
    }
})();

FAQs

Package last updated on 02 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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