Giter Club home page Giter Club logo

krunker.js's Introduction

A simple, easy to use module for interacting with the Krunker.io Social Page

Setup and Installation

$ npm i krunker.js

Promise-based Example Usage

// Require the NPM Module
const KrunkerJS = require('krunker.js');
// Create a new instance
const Krunker = new KrunkerJS();

// Get the stats of the user
Krunker.getUser('Helinho').then(data => {
	// Console log the user stats as an object
	console.log(data);
	// [V1.2^ Feature] Gets all stats ready as an object
	console.log(data.simplified);

	// Convert Player Score to Level
	Krunker.getLevel(data);
	// Convert Time Played
	Krunker.getPlayTime(data);
	// Get user KDR
	Krunker.getKDR(data);
	// Get W/L
	Krunker.getWL(data);
	// Get SPK
	Krunker.getSPK(data);
}).catch(console.error);

async/await-Based Example

// Require the NPM Module
const KrunkerJS = require('krunker.js');
// Create a new instance
const Krunker = new KrunkerJS();

(async () => {
	try {
		// Get the stats of the user
		const user = await Krunker.getUser('Helinho');
		// Console log the user stats as an object
		console.log(user);
		// [V1.2^ Feature] Gets all stats ready as an object
		console.log(user.simplified);
	} catch (e) {
		console.error(e);
	}
})();

Help

If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join my Development Server.

krunker.js's People

Contributors

xazz avatar izexi avatar dependabot[bot] avatar

Stargazers

 avatar  avatar Zubair avatar wuming avatar David de Moura Marques avatar MrAlex avatar James avatar

Watchers

James Cloos avatar  avatar

krunker.js's Issues

Not Working Find data of metrics

Hi,

I make a request like in the example, but I have no answer and the request returns me timeout for IP 172.64.172.6:8008

Reponse:

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: connect ETIMEDOUT 172.64.172.6:8008
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)

Request:

// Require the NPM Module
const KrunkerJS = require('krunker.js');
// Create a new instance
const Krunker = new KrunkerJS();

(async () => {
	try {
		// Get the stats of the user
		const user = await Krunker.getUser('Helinho');
		// Console log the user stats as an object
		console.log(user);
		// [V1.2^ Feature] Gets all stats ready as an object
		console.log(user.simplified);
	} catch (e) {
		console.error(e);
	}
})();

NOTE: lib version: ^1.2.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.