monsterid

NodeJs version of monsterId library by Andreas Gohr

NodeJs implementation of monsterId PHP library. Create unique avatar based on a seed. It depends by node-gd, crypto and srand npm packages.

$ npm install monsterid
//Include monsterId and create an http Server. 
var monsterId = require('monsterid');
var http = require('http');
 
http.createServer(function(reqres) {
    // Create your seed.  
    var seed = 'abcdefg';
    
    var avatar = new monsterId(seed);
 
    // use public method getAvatar to retrieve an image in binary format. 
    res.writeHead(200, {'Content-type':'image/png'});
    res.end(avatar.getAvatar(), 'binary');
}).listen('8088');

Thanks to Andreas Gohr for his job on the original library.