This package sends SLP (see here) request to a minecraft server and return the result.
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>"
}