Nth Permutation Mathematics
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

char-to-avatar

0.2.0 • Public • Published

char-to-avatar

Convert a character to avatar image in NodeJS.

NPM version Build Status

Dependencies

Demo

Installation

npm install char-to-avatar

API

var CharToAvatar = require('char-to-avatar')

new CharToAvatar(character[, options])

  • character: {String}, a character to render.
  • options.color: {String}, character color, default to '#ffffff'.
  • options.backgroundColor: {String}, background color, default to '#383838'.
  • options.shape: {String}, 'square' or 'circle',avatar shape, default to 'square'.
  • options.size: {Number}, avatar size, default to 100.

CharToAvatar.prototype.pngStream()

Return a png image stream.

CharToAvatar.prototype.jpegStream([quality])

Return a jpeg stream.

  • quality: {Number}, 0 - 100, jpeg quality, default is 85.

CharToAvatar.prototype.toBuffer()

Return a thunk function that guarantee a png image buffer.

CharToAvatar.prototype.toDataURL([mime])

Return a thunk function that guarantee a image data string.

  • mime: {String}, mime type, default is 'image/png'.

install

npm i char-to-avatar

Downloadsweekly downloads

6

version

0.2.0

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability