1.0.4 • Published 5 years ago

pubg.api.ts v1.0.4

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

PUBG API for Typescript

License NPM Version Node Version Typescript Version Build Status Coverage Status

PUBG's REST API in an easy to use async/await, promise based library for Typescript.

Installation and Usage

Install via npm or yarn

# Through npm
npm install pubg.api.ts --save
# Through yarn
yarn add pubg.api.ts

Start using by invoking the PubgApi class

import { PubgApi } from 'pubg.api.ts';

const Api = new PubgApi('MY-PUBG-API-KEY');

Configuration

Configure default values by passing them into the PubgApi Class

import { PubgApi } from 'pubg.api.ts';

export const PubgApiDefaults = {
    ApiUrl: 'https://api.pubg.com/shards',
    Shard: 'steam'
};

const Api = new PubgApi('MY-PUBG-API-KEY', PubgApiDefaults);

// Can also view defaults by accessing it with the defaults key
Api.defaults;

Unit Test Cases

You can run unit test cases by running

# Through npm
npm run test
# Through yarn
yarn test

Please note you need to have a valid PUBG API Key for tests to run

export PUBG_KEY='MY-PUBG-API-KEY'

API Documentation

Everything you need to know in regards to how the api works is in API.md

Referencing via JSDoc

You can build documentation through JSDoc by running

# Through npm
npm run jsdoc
# Through yarn
yarn jsdoc

Additional Resources

  • If you need help, :mailbox: hello@chriscates.ca

  • If you have a feature request, feel free to open an issue

  • MIT Licensed