2.5.0 • Published 2 years ago

leagueapiwrapper v2.5.0

Weekly downloads
86
License
ISC
Repository
github
Last release
2 years ago

LeagueAPIWrapper (Node.JS)

Simple Wrapper for all League Of Legends API methods

https://www.npmjs.com/package/leagueapiwrapper

let LeagueAPI = require('leagueapiwrapper');
LeagueAPI = new LeagueAPI(leagueAPIKey, Region.NA);

LeagueAPI.getSummonerByName('LeagueOfSausage')
    .then(function(accountInfo) {
        // do something with accountInfo
	console.log(accountInfo);
    })
    .catch(console.error);

LeagueAPI.initialize()
    .then(function(){ return LeagueAPI.getFeaturedGames() })
    .then(function(data) {
        console.log(data);
    })
    .catch(console.error);

Methods

// Objects will now contain full objects, instead of id's. 
// E.G from 'mapId: 12' to 'mapObject: { id: 12 name: howlingAbyss ... }'
LeagueAPI.initialize()
    .then() {
    	// LeagueAPI returned objects will now have details from DDRagon API.
    })
    .catch(console.error);

// Gets the version of DDRagon that's included in this project. You can still use other versions, but it will require additional network calls to DDragon.
// E.G from '11.1.1'
LeagueAPI.getDDragonLocalDataVersion();

// Setting initialize() sets to true.
// Must call initialize if setting this to true
LeagueAPI.setFullyLoadClasses(false);

// Changed Region for API calls
LeagueAPI.changeRegion(Region.NA);

// Returns thirdPartyCode. Note: will 'Forbidden' if no thirdPartyCode is available for the accountInfo/accountId
// Note: I don't have an accountId example that works here
LeagueAPI.getThirdPartyCode(accountId)
	.then(function(data) {
		console.log(data);
	})
	.catch(console.error);

// Gets the Match ids for the tournamentCode. Note: I don't have an example tournament code
LeagueAPI.getMatchIdsByTournament(tournamentCode)
	.then(console.log)
	.catch(console.error);

LeagueAPI.getClash(accountObj)
	.then(console.log)
	.catch(console.error);

LeagueAPI.getClashTournament()
	.then(console.log)
	.catch(console.error);

LeagueAPI.getSummonerByName('LeagueOfDrMundo').then(function(accountObject) {
	LeagueAPI.getLeagueRanking(accountObject)
		.then(console.log)
		.catch(console.error);
});

// Returns an accountObject which can be used in other methods, or view account information on
LeagueAPI.getSummonerByName('LeagueOfDrMundo')
	.then(function(accountObject) {
		console.log(accountObject);
	})
	.catch(console.error);

// Returns the championMastery details for the given account/accountId and champion/championId LeagueAPI.getChampionMasteryByChampion(leagueOfDrMundoSummonerId, drMundoChampId) .then(console.log) .catch(console.error);

</p>
</details>

<details><summary>getFreeChampionRotation()</summary>
	
<p>
	
####
```javascript

// Returns details for the current champion rotation. Initialize first for details on each champion
LeagueAPI.getFreeChampionRotation()
	.then(console.log)
	.catch(console.error);

Disclaimer

MundoScript is not endorsed by Riot Games and does not reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.

Feel free to make suggestions on features/etc.

2.5.0

2 years ago

2.4.1

3 years ago

2.4.0

3 years ago

2.3.3

3 years ago

2.3.2

3 years ago

2.3.0

3 years ago

2.3.1

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

4 years ago

2.0.8

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.3

4 years ago

2.0.0

4 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago