name2avatar

1.0.7 • Public • Published

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);

Package Sidebar

Install

npm i name2avatar

Weekly Downloads

1

Version

1.0.7

License

ISC

Unpacked Size

170 kB

Total Files

4

Last publish

Collaborators

  • lazzy_ms