Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gimenete/identicons

Generate SVG identicons in node and the browser
https://github.com/gimenete/identicons

Last synced: about 1 month ago
JSON representation

Generate SVG identicons in node and the browser

Awesome Lists containing this project

README

        

# identicons

Simple module to create SVG identicons like the ones used by [GitHub](https://github.com/blog/1586-identicons).

![Identicon](https://raw.githubusercontent.com/gimenete/identicons/master/examples/identicon.png)

## Installing

```
npm install identicons --save
```

## Usage

### SVG DOM

```html


```

```javascript
var svg = identicons.generateSVGDOM('[email protected]', { width: 200, size: 5 })
document.getElementById('identicon').appendChild(svg)
```

### SVG Data URI

```html

```

```javascript
var src = identicons.generateSVGDataURIString('[email protected]', { width: 200, size: 5 })
document.getElementById('identicon').setAttribute('src', src)
```

### SVG String

```html


```

```javascript
var svg = identicons.generateSVGString('[email protected]', { width: 200, size: 5 })
document.getElementById('identicon').innerHTML = svg
```