Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@beyonk/initials-avatar

Package Overview
Dependencies
Maintainers
5
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beyonk/initials-avatar

Initials based avatar generator in pure JS

latest
npmnpm
Version
1.1.6
Version published
Weekly downloads
45
-35.71%
Maintainers
5
Weekly downloads
 
Created
Source




image

Initials Avatar

js-standard-style

Generates image based avatars from initials, in node.

Uses a random background colour and a contrasting foreground colour.

Uses pure javascript, no native dependencies.

Install

$ npm install --save @beyonk/initials-avatar

Usage

Add the plugin to your loadtest configuration:

const { createWriteStream } = require('fs')
const { createAvatar } = require('@beyonk/initials-avatar')

const output = createWriteStream('/some/output/file.jpg')
await createAvatar({ firstName: 'Antony', lastName: 'MacKenzie-Jones' }, output)

Config

Changing avatar size

You can change the default avatar size from 128px

await createAvatar({ firstName: 'Antony', lastName: 'MacKenzie-Jones' }, output, { size: 512 })

Forcing avatar background-colour

You can choose the background colour (and the foreground will contrast automatically)

await createAvatar({ firstName: 'Antony', lastName: 'MacKenzie-Jones' }, output, { background: '#ff0c7e' })

FAQs

Package last updated on 01 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts