@fasetto/krunker.io

0.4.2 • Public • Published

UnOfficial Api for interacting with the Krunker.io Social Page

Setup and Installation

$ npm i @fasetto/krunker.io

Getting Started

Profile Informations

const { Krunker: Api, OrderBy, UserNotFoundError } = require("@fasetto/krunker.io")

const Krunker = new Api();

const PrintUserData = async () =>
{
    try
    {
        const user = await Krunker.GetProfile("fasetto");
        console.log(user);
    }
    catch (e)
    {
        if (e instanceof UserNotFoundError)
            console.log("Sorry ):\nWe couldn't find that user!");
        else
            console.log(e.message);
    }

}

// {
//   name: 'fasetto',
//   id: 124403,
//   score: 846605,
//   level: 27,
//   levelProgress: 60,
//   kills: 7935,
//   deaths: 5774,
//   kdr: '1.37',
//   kpg: '7.94',
//   spk: '106.69',
//   totalGamesPlayed: 1003,
//   wins: 413,
//   loses: 590,
//   wl: '0.41',
//   playTime: '3d 9h 44m',
//   funds: 550,
//   clan: 'PUSU',
//   featured: 'No',
//   hacker: false,
//   following: 1,
//   followers: 0,
//   shots: 1453,
//   hits: 554,
//   nukes: 0,
//   meleeKills: 0,
//   createdDate: '2018-07-09',
//   createdTime: '13:13:25',
//   lastPlayedClass: 'Vince',
//   elo: 0,
//   elo2: 0,
//   elo4: 0
// }

PrintUserData();

Leaderboard Informations

const { Krunker: Api, OrderBy } = require("@fasetto/krunker.io")

const PrintLeaderboard = async () =>
{
    try
    {
        const leaderboard = await Krunker.GetLeaderboard(OrderBy.Funds);
        console.log(leaderboard);

    }
    catch (e)
    {
        console.log(e.message);
    }
}

PrintLeaderboard();

Clan Informations

const { Krunker: Api, OrderBy, ClanNotFoundError } = require("@fasetto/krunker.io")

const PrintClan = async () =>
{
    try
    {
        const clan = await Krunker.GetClan("24/7");
        console.log(clan);
    }
    catch (e)
    {
        if (e instanceof ClanNotFoundError)
            console.log("Sorry ):\nWe couldn't find that clan!");
        else
            console.log(e.message);
    }
}

PrintClan();

Game Informations

const { Krunker: Api, GameNotFoundError } = require("@fasetto/krunker.io")

const PrintGameInfo = async () =>
{
    try
    {
        const gameInfo = await Krunker.GetGameInfo("FRA:piucd");
        console.log(gameInfo);
    }
    catch (e)
    {
        if (e instanceof GameNotFoundError)
            console.log("Game not found!");
        else
            console.log(e.message);
    }
}

// {
//   region: 'Frankfurt',
//   players: '8/8',
//   map: 'ffa_Subzero',
//   custom: false
// }

PrintGameInfo();

Contact

Discord: fasetto#5885

Package Sidebar

Install

npm i @fasetto/krunker.io

Weekly Downloads

0

Version

0.4.2

License

MIT

Unpacked Size

16.4 kB

Total Files

7

Last publish

Collaborators

  • fasetto