@dudadev/random-img

1.0.1 • Public • Published

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 */)

Readme

Keywords

Package Sidebar

Install

npm i @dudadev/random-img

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

1.77 kB

Total Files

3

Last publish

Collaborators

  • dixiecarbonic
  • yoavporat
  • liady
  • russjeffery
  • idanen
  • hilakerer
  • sharon_rub
  • talkor
  • dannyr-duda
  • shira.weiss
  • roiekoper-duda
  • everett-duda