node package manager


Node.js monsterId

Create your unique monstrous avatar

Build Status

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

How to use

//Include monsterId and create an http Server. 
var http      = require('http');
var monsterId = require('monsterid');
http.createServer(function(req, res) {
    // 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');

Transpile and test

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.