Node.js version of monsterId library by Andreas Gohr

Create your unique monstrous avatar

Node.js implementation of monsterId PHP library. Create a unique avatar based on a seed number.

This library depend on node-gd so You must have libgd installed in your system.

$ npm install monsterid
//Include monsterId and create an http Server. 
var http      = require('http');
var monsterId = require('monsterid');
http.createServer(function(reqres) {
    // Your username. 
    var username  = 'username';
    // Use method getAvatar to retrieve an image in binary format. 
    var avatar    = monsterId.getAvatar(username);
    res.writeHead(200, {'Content-type':'image/png'});
    res.end(avatar, 'binary');

The library is authored in ES2015 and transpiled with Babel.
To transpile the src files run this command:

$ npm run build

To launch unit tests (with Tape) run this command:

$ npm run test

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