1.1.1 • Published 6 months ago

simple-identicon v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

simple-identicon

Dependencies

  • canvas - A Cairo-backed Canvas implementation for Node.js.

Notes on canvas

For canvas to work, please check the installation guide for your platform.

Installation

npm install simple-identicon

# or

yarn add simple-identicon
const { generateIdenticon } = require('simple-identicon');

const myValue = 'my-value'; // Can be a username for example

const buffer = generateIdenticon(myValue);

// Use the buffer

There are also some helpers for most common use cases:

const { saveIdenticon, generateIdenticonDataUrl } = require('simple-identicon');

const myValue = 'my-value'; // Can be a username for example

// Save the identicon to a file
saveIdenticon(myValue, 'my-identicon.png');

// Or data URL

const dataUrl = generateIdenticonDataUrl(myValue);

// Use the data URL on the browser
const img = document.createElement('img');

img.src = dataUrl;

document.body.appendChild(img);
1.1.1

6 months ago

1.1.0

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago