Skip to content

nstr/gravatary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gravatary

The Gravatar Generator

demo

Installation

npm i gravatary --save

Usage:

Create random gravatar

import gravatary from "gravatary";

let image = gravatary(); // data:image/png;base64,...

Create gravatar from hashstring without options.

import gravatary from "gravatary";

let image = gravatary("hashstring"); // data:image/png;base64,...

Create gravatar with hash and options.

import gravatary from "gravatary";

let image = gravatary("hashstring", {margin: 0.08, size: 450, background: [0, 0, 0]}); // data:image/png;base64,...

Options

Property Type Description
margin float inner margin
size int px. size of an image
background array of int RGB background for a gravatat

Releases

No releases published

Packages

No packages published