leagueoflegends-js
v0.0.6
Published
A library that is used to fetch League Of Legends data from the Riot Games API.
Downloads
9
Maintainers
Readme
leagueoflegends-js
A wrapper for the Riot League Of Legends API.
Installation
npm i leagueoflegends-js
Methods (API)
Construct
const lol = require('leagueoflegends-js');
const api = new lol.API({
apikey: "yOuR-aPi-kEy",
reigon: "euw1"
});
// apikey is required.
// reigon sets to na1 as default
findSummoner(name)
api.findSummoner("fiqstro").then(summoner => {
console.log(summoner)
})
Methods (DataDragon)
Construct DataDragon
const lol = require('leagueoflegends-js');
const datadragon = new lol.DataDragon("11.1.1") // The default version is 11.1.1
findChampion()
const lol = require('leagueoflegends-js');
const datadragon = new lol.DataDragon();
datadragon.findChampion("Akali").then(champion => {
console.log(champion.name);
// Akali
})
findItem()
const lol = require('leagueoflegends-js');
const datadragon = new lol.DataDragon();
datadragon.findItem("Zeal").then(item => {
console.log(item.name)
// Zeal
})
findSpell()
const lol = require('leagueoflegends-js');
const datadragon = new lol.DataDragon();
datadragon.findItem("Flash").then(spell => {
console.log(spell.name)
// Flash
})
fetchAllItems()
const lol = require('leagueoflegends-js');
const datadragon = new lol.DataDragon();
datadragon.fetchAllItems().then(items => {
console.log(items);
// [ ... ]
})
fetchAllSpells()
const lol = require('leagueoflegends-js');
const datadragon = new lol.DataDragon();
datadragon.fetchAllItems().then(spells => {
console.log(spells)
// [ ... ]
})