JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 26
  • Score
    100M100P100Q61815F
  • License MIT

Playerunknown's Battlegrounds API Wrapper

Package Exports

  • pubg-api-redis

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 (pubg-api-redis) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

npm version License: MIT

pubg-api-redis

Playerunknown's Battlegrounds API Wrapper with Redis caching.

Installation

npm install -S pubg-api-redis

Usage

First, generate your development APIKEY from PUBG Tracker (https://pubgtracker.com/site-api)

const {PubgAPI, PubgAPIErrors} = require('pubg-api-redis');

// If no Redis configuration it wont be cached
const api = new PubgAPI({
  apikey: 'XXXXX',
  redisConfig: {
    host: '127.0.0.1',
    port: 6379,
  },
});

api.profile.byNickname('javilobo8')
  .then((data) => {
    console.log(data);
  });

api.profile.bySteamId('76561198084956266')
  .then((data) => {
    console.log(data);
  });

Tests

You can run tests with your development API KEY stored in environment variable

PUBGTRACKERAPIKEY=<your-api-key> npm t