0.1.0 • Published 8 years ago

identicons v0.1.0

Weekly downloads
355
License
MIT
Repository
-
Last release
8 years ago

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