0.7.0 • Published 7 years ago

league-wrapper v0.7.0

Weekly downloads
2
License
AGPL-3.0
Repository
github
Last release
7 years ago

league-wrapper

A wrapper for the League of Legends official API.

Introduction

This project aims to provide an easy to use interface for the League of Legends API. Since it's my first public project, please feel free to contact me and leave some feedback.

Also please keep in mind that this is not a stable version yet, so interface spec might change while the implementation is still worked on.

Installation

$ npm install league-wrapper

Features

  • Wrapper for all provided services
  • Fully documented
  • JSDoc for the Response DataObjects
  • Can be used both as Promise or with callbacks

Example Usage

Getting started

The LeagueWrapper accepts the API key and an object with the default region used for the requests. You can get your key from the Developer Portal.

If no region is passed the Wrapper will default to Region.EUW. Possible regions can be found here

const LeagueWrapper = require('league-wrapper');

const api = new LeagueWrapper('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', {
  region: LeagueWrapper.Region.EUW
});

Using Promise

api.summoner.getByNames('PostCrafter').then(function(summoners) {
  console.log(summoners);
});
/* Console output:
  {
    postcrafter: {
      id: 48944322,
      name: 'PostCrafter',
      profileIconId: 1376,
      summonerLevel: 30,
      revisionDate: 1476740328000
    }
  }
*/

Using callback

api.summoner.getByNames('PostCrafter', function(error, summoners) {
  console.log(summoners);
});
/* Console output:
  {
    postcrafter: {
      id: 48944322,
      name: 'PostCrafter',
      profileIconId: 1376,
      summonerLevel: 30,
      revisionDate: 1476740328000
    }
  }
*/

Documentation

See here.

Examples

See here.

License

AGPL-3.0

0.7.0

7 years ago

0.6.2

8 years ago

0.6.1

8 years ago

0.5.5

8 years ago

0.5.4

8 years ago

0.5.3

8 years ago

0.5.2

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago