Nostradamus Prophecy Machine
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    monsteridpublic

    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.

    Installation

    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');
    }).listen('8088');

    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
    

    Credits

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

    install

    npm i monsterid

    Downloadslast 7 days

    1

    version

    0.1.4

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar