Package Exports
- mika
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mika) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
an unofficial javascript wrapper for the opendota api. docs
###examples
const Mika = require('mika')
var mika = new Mika();
mika.getPlayer('<your account id>').then((player) => {
console.log(`Solo MMR: ${player.solo_competitive_rank}`)
console.log(`Account ID: ${player.profile.account_id}`)
console.log(`Name: ${player.profile.personaname}`)
}).catch((response) => {
console.log(`statusCode: ${response.statusCode}`)
console.log(`body: ${response.body}`)
})
mika.getPlayerCounts('<your account id>').then((counts) => {
let leavers = 0
for (leaver_stat in counts.leaver_status) {
if (leaver_stat != "0") {
leavers += counts.leaver_status[leaver_stat].games
}
}
console.log(`\nGames with at least one leaver: ${leavers}`)
}).catch((response) => {
console.log(`statusCode: ${response.statusCode}`)
console.log(`body: ${response.body}`)
})