robohash-avatars
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Robohash Avatars

Generate robot-based avatar images based on any text.

Build status Azure DevOps tests (branch) Azure DevOps coverage Quality Gate Status Maintainability Rating MIT License npm

Usage

After installing, simply import Robohash Avatars in your file.

const robohashAvatars = require("robohash-avatars");

Consume the generateAvatar() API to get an avatar URL that you can use directly as an image. Supply the settings object to this method to generate the avatar image URL accordingly. Username is required. For the remainder, you can supply them based on your requirement. All settings are pretty self-explanatory.

var avatarURL = robohashAvatars.generateAvatar({   
            username: "tonystark", 
            background: robohashAvatars.BackgroundSets.RandomBackground1,
            characters: robohashAvatars.CharacterSets.Kittens,
            height: 400,
            width: 400
        }); 

Options

CharacterSets supports Robots, Monsters, DisembodiedHeads and Kittens. BackgroundSets supports RandomBackground1 and RandomBackground2

Examples

Clicking on the images below opens the image in a browser window.

Sample image 1 Sample image 2 Sample image 3

Release notes

Release notes can be found here.

Credits

RoboHash.org is developed by Colin Davis / RoboHash GitHub.
This npm package is developed by Clyde D'Souza.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    47
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    47
  • 1.0.0
    0
  • 0.9.0
    0

Package Sidebar

Install

npm i robohash-avatars

Weekly Downloads

47

Version

1.0.1

License

MIT

Unpacked Size

13.1 kB

Total Files

9

Last publish

Collaborators

  • clydedsouza