@beyonk/initials-avatar

1.1.6 • Public • Published




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' })

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.6150latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.6150
1.1.01
1.0.21

Package Sidebar

Install

npm i @beyonk/initials-avatar

Weekly Downloads

152

Version

1.1.6

License

MIT

Unpacked Size

98.1 kB

Total Files

6

Last publish

Collaborators

  • antony
  • adampond
  • alex.dilley
  • jedwoodcock
  • leandro.silva
  • tomlewis0
  • puruvj