Socket
Socket
Sign inDemoInstall

@beyonk/initials-avatar

Package Overview
Dependencies
5
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @beyonk/initials-avatar

Initials based avatar generator in pure JS


Version published
Weekly downloads
22
decreased by-35.29%
Maintainers
1
Install size
2.20 MB
Created
Weekly downloads
 

Readme

Source

Beyonk

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

Last updated on 25 Oct 2019

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc