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

    dazzlepublic

    Dazzle - a Dota 2 Api Wrapper for Node

    Dazzle is a lightweight, easy-to-use API client for the Dota 2 WebAPI http://wiki.teamfortress.com/wiki/WebAPI#Dota_2. Check it out on github @ https://github.com/JamieLottering/dazzle-node

    Installation

    npm install dazzle
    

    Requirements

    Get a Steam API key at http://steamcommunity.com/dev/apikey
    

    Usage & Examples

    var dazzle = require('dazzle');
    var dota2Api = new dazzle('apikey');
    

    Get a list of heroes

    dota2Api.getHeroes(function (err, response) {
        var heroes = response.heroes;
    });
    

    Get recent matches

    dota2Api.getMatchHistory(function (err, response) {
        var matches = response.matches;
    });
    

    Easily extendable

    To create your own API method simply extend the client like so:

    dota2Api.extend('myFancyMethod', function (params, next) {
        // do somethin cool here
        this.invoke('MethodName')
            .using(params)
            .on('InterfaceName')
            .then(next);
    });
    
    dota2Api.myFancyMethod({}, function (err, response) {
        // hey it works!
    });
    

    For a list of methods and interfaces see http://wiki.teamfortress.com/wiki/WebAPI#Dota_2. Note that you dont need to include the app ID (aka _570), this is added automatically.

    License

    The MIT License (MIT)

    Author

    Jamie Lottering GitHubhttp://well.iotwitter

    Keywords

    none

    install

    npm i dazzle

    Downloadsweekly downloads

    32

    version

    1.0.4

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar