Need private packages and team management tools?Check out npm Teams »

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

Install

npm i @dudadev/random-img

DownloadsWeekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

1.77 kB

Total Files

3

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar