Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@dudadev/random-img

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dudadev/random-img

Generates a random user image from randomuser.me

latest
npmnpm
Version
1.0.1
Version published
Maintainers
2
Created
Source

Random Avatar URL

Generates a random avatar URL from randomuser.me

Usage

npm install --save @dudadev/random-img

The main export is a function that returns a promise:

const imgGen = require('@dudadev/random-img');
imgGen().then(avatarURL => {...});

If invoked without options, the function will return a random avatar.

Configuration

options.gender

Can be either men or women, to ask for a specific gender.

options.id

Can be a number between 1-96 to ask for a consistent id.

Example

imgGen({ gender: 'men', id: 5 })
    .then(avatarUrl => /* will be the same image on every call of the function */)

Keywords

random

FAQs

Package last updated on 11 Mar 2018

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