Named Avatar Generator
Generate default avatars based on user's name without a sweat
How to use ❓
- Install the library
npm install named-avatar-generator --save
- Start creating avatars
const AvatarGenerator = ; AvatarGenerator;
The above code will generate an awesome default avatar as shown below
Available options
AvatarGenerator;
Option | Description | Default |
---|---|---|
name | Full name of the user | No default value |
size | Size of the avatar in pixels | 40 |
bgColor | Background color of the avatar | A random beautiful color |
font | BM font path | Sans with best font size |
Utility Functions
Write avatar
This can be used to write the image to the filesystem
AvatarGenerator ;
Get image as Data URI
This can be used to get the image as data URI
AvatarGenerator ;
Get image as buffer
This can be used to get the image as buffer
AvatarGenerator ;
Available MIME
The supported MIME are
- jpeg
- png
- bmp
License
MIT © Ameer Jhan