npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pubg.io

v0.1.18

Published

A complimentary Node wrapper for PlayerUnknown: Battlegrounds.

Downloads

20

Readme

pubg.io

An ES6 Promise A+ Compliant NodeJS Library for the Official PlayerUnknown: Battlegrounds API.

PLEASE NOTE - This is an unfinished wrapper until the PUBG API is officially released to the public. Although tested, I can't guarantee this will consistently work until I have created a full release. You're free to test it if you have an API key, however and will accept collaborations. 🤘

Install

Install with Yarn

yarn add pubg.io

Install with NPM

npm install pubg.io

Import (ES6)

import { PUBGAPI } from 'pubg.io';

Defaults

Option | Type | Default | Description --- | --- | --- | --- platform | String | 'PC' | The platform to get data from. You can use PC or Xbox region | String | 'EU' | The region to get data from. See https://goo.gl/MqbFty for allowed regions. query | Object | {} | The Query String object to pass additional filters/requests.

Usage

const api = new PUBGAPI('InsertAPIKeyHere');

Match

https://developer.playbattlegrounds.com/docs/en/matches.html

Defaults & Limitations

  • Data retention period is 14 days
  • The max search time span between createdAt-start and createdAt-end is 14 days.
  • If you don’t specify createdAt-start, the default is now() - 14 days.
  • If you don’t specify createdAt-end, the default is now().
  • If you search for a time > now, the default is now().
  • If you search for a time before the retention period, the default is the retention period (now() - 14 days).
  • If createdAt-start >= createdAt-end, you will receive an error.

GET_MATCH

api.get('match', { id: Number, ...options }, (match, error) => {
	console.log(match || error);
});

GET_MATCHES

api.get('matches', { ...options }, (match, error) => {
	console.log(matches || error);
});

Filters

Use the query option to set filters/sorting parameters.

Oldest First

api.get('matches', { query: { sort: 'createdAt' } }, (match, error) => {
	console.log(match || error);
});

Newest First

api.get('matches', { query: { sort: '-createdAt' } }, (match, error) => {
	console.log(match || error);
});

Limit

// Limit to 2 items
api.get('matches', { query: { 'page[limit]': '2' } }, (match, error) => {
	console.log(match || error);
});

Offset

// Offset data by 2 items, returning item 2 through to 5.
api.get('matches', { query: { 'page[limit]': '5', 'page[offset]': '2' } }, (match, error) => {
	console.log(match || error);
});

Testing

Testing is carried out with Mocha. To test, run:

npm test

TODO

  • Build calls to GET_TELEMETRY data
  • Refactor/implement individual calls, i.e.,
import {
	PUBGAPI,
	Match,
	Matches
} from 'pubg.io';

const myAPI = new PUBGAPI(key);

const myMatch = new Match(key, ...options, callback);