Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/gimenete/identicons
- Owner: gimenete
- Created: 2015-12-13T17:52:06.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-13T18:06:39.000Z (almost 9 years ago)
- Last Synced: 2024-04-14T23:06:43.778Z (7 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```