1.8.0 • Published 1 year ago

@javilobo8/riot-api v1.8.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@javilobo8/riot-api

npm package Build Status Downloads Issues Code Coverage

Another Riot API wrapper for Node.js.

Features

  • Fully typed
  • Promise-based
  • Constants
  • Axios based requests

TODO

  • Add replacement for DDragon CDN host
  • Add Redis cache
  • Parse response and error Rate Limit headers
  • Add new spectator byPuuid v5 endpoint

Installation

npm install @javilobo8/riot-api

Usage

import { RiotAPILOL, DDragonAPI } from '@javilobo8/riot-api';

// RiotAPILOL
const riotApi = new RiotAPILOL({
  apiKey: 'RGAPI-XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
});

const accountResponse = await riotApi.account.byRiotId('EUW', 'javilobo8', 'zoso');
/*
{
  data: {
    puuid: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
    gameName: 'javilobo8',
    tagLine: 'zoso',
  },
  status: 200,
  statusText: 'OK',
  headers: {
    'x-app-rate-limit': 'XX:XX,XX:XX',
    'x-method-rate-limit': 'XX:XX,XX:XX',
    'x-app-rate-limit-count': 'XX:XX,XX:XX',
    'x-method-rate-limit-count': 'XX:XX,XX:XX',
    ...
  },
}
*/

// DDragonAPI
const ddragonApi = new DDragonAPI();

const versionResponse = await ddragonApi.ddragon.getCurrentVersion();
/*
{
  data: '11.16.1', // Current patch version
  status: 200,
  statusText: 'OK',
  headers: {
    ...
  },
}
*/

Debugging

This package uses the debug package to log debug messages. To enable debug messages, set the DEBUG environment variable to riot-api:*.

DEBUG=riot-api:* node your-app.js

Base package: @javilobo8/riot-api

1.8.0

1 year ago

1.7.0

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.5.0

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.2.2

1 year ago

1.3.0

1 year ago

1.2.1

1 year ago

1.0.2

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

0.0.0

1 year ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago