Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
2
Weekly downloads
 
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

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

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