Skip to content

This package helps you generate a svg/png image buffer from the initials (extracted from name)

Notifications You must be signed in to change notification settings

lazzyms/name2avatar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

name-to-avatar

Description: This package helps you generate a svg/png image buffer from the initials (extracted from name).

Installation

npm i name2avatar

Usage

const name2avatar = require('name2avatar');
const options = {
    size: 200, // Image size in px
    bgColor: '#ffffff', // Background color
    color: '#000000', // Font color
    text: 'John Doe', // Full name
    isRounded: true, // want a circular radius?
    type: 'svg' // or 'png'
};
const imgBuffer = name2avatar.getImageBuffer(options);

// Optional
const  fs = require('fs');
fs.writeFileSync(`avatar.svg`, imgBuffer);

About

This package helps you generate a svg/png image buffer from the initials (extracted from name)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published