gimenete / identicons

Generate SVG identicons in node and the browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

identicons

Simple module to create SVG identicons like the ones used by GitHub.

Identicon

Installing

npm install identicons --save

Usage

### SVG DOM

<div id="identicon"></div>
var svg = identicons.generateSVGDOM('username@example.com', { width: 200, size: 5 })
document.getElementById('identicon').appendChild(svg)

SVG Data URI

<img id="identicon">
var src = identicons.generateSVGDataURIString('username@example.com', { width: 200, size: 5 })
document.getElementById('identicon').setAttribute('src', src)

SVG String

<div id="identicon"></div>
var svg = identicons.generateSVGString('username@example.com', { width: 200, size: 5 })
document.getElementById('identicon').innerHTML = svg

About

Generate SVG identicons in node and the browser


Languages

Language:JavaScript 100.0%