robohash-avatars
v1.0.1
Published
Generate robot-based avatar images for any text.
Downloads
66
Maintainers
Readme
Robohash Avatars
Generate robot-based avatar images based on any text.
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.
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.