NodeJS

Table of contents

About

Hylaria-Lib is a powerful Node.js module that allows you to easily interact with the Hylaria API

Installation

Getting started

Fetch Player

// CommonJS usage
const hylaria = require('hylaria-lib');
// Fetch an user named Yumekowo
hylaria.fetchPlayer('Yumekowo')
.then(function (player) {
// can now interact with Player instance
console.log(player.username);
})
.catch(function (error) {
// handle error
console.error(error);
});
// You can also fetch a player by his UUID
hylaria.fetchPlayer('9581c43c2b9d4fbdb3de91115363c3ce')
.then(function (player) {
// can now interact with Player instance
console.log(player.username);
})
.catch(function (error) {
// handle error
console.error(error);
});

Fetch Server

// CommonJS usage
const hylaria = require('hylaria-lib');
// Fetch Hypixel
hylaria.fetchServer('play.hypixel.net')
.then(function (server) {
// can now interact with Server instance
console.log(server.address);
})
.catch(function (error) {
// handle error
console.error(error);
});
// You can also provide a server port
hylaria.fetchServer('play.hypixel.net', 25565)
.then(function (server) {
// can now interact with Server instance
console.log(server.address);
})
.catch(function (error) {
// handle error
console.error(error);
});

More things are available in the documentation: docs.hylaria.com

Links