monsterid

NodeJs version of monsterId library by Andreas Gohr

npm install monsterid
2 downloads in the last week
8 downloads in the last month

Node Js monsterId

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

Installation

$ npm install monsterid

How to use

//Include monsterId and create an http Server.
var monsterId = require('monsterid');
var http = require('http');

http.createServer(function(req, res) {
    // 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');

Credits

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

npm loves you