0.2.1 • Published 3 years ago

minecraft-slp v0.2.1

Weekly downloads
60
License
LGPL-3.0-or-later
Repository
github
Last release
3 years ago

Minecraft-SLP

Description

This package sends SLP (see here) request to a minecraft server and return the result.

How to use

This package wrap the ping into a Promise, you can use it like :

import mcSLP from 'minecraft-slp';
mcSLP().then(() => {
  // Success
}, () => {
  // Error
});

Or you can use it with async/await

import mcSLP from 'minecraft-slp';

async function myFunction() {
  await mcSLP();
}

The result format in case of success is :

{
    "version": {
        "name": "1.8.7",
        "protocol": 47
    },
    "players": {
        "max": 100,
        "online": 5,
        "sample": [
            {
                "name": "thinkofdeath",
                "id": "4566e69f-c907-48ee-8d71-d7ba5aa00d20"
            }
        ]
    },
    "description": {
        "text": "Hello world"
    },
    "favicon": "data:image/png;base64,<data>"
}

Created by SOUQUET Thibault