docs: overhaul README and provide new usage examples

The README.md has been completely rewritten. Also the `example`
directory has been renamed to `examples` and its content
has been replaced with a more structured and practical set of scripts.
This commit is contained in:
2025-06-25 13:16:42 +03:00
parent 0bf30140b7
commit 7222eeae3c
7 changed files with 230 additions and 78 deletions

19
examples/01-basic-ping.js Normal file
View File

@ -0,0 +1,19 @@
import { pingJava, pingBedrock } from "../index.js";
try {
const javaData = await pingJava("hypixel.net");
console.log("--- Java Server ---");
console.log(javaData);
} catch (error) {
console.error("Could not ping Java server:", error);
}
console.log("\n" + "=".repeat(20) + "\n");
try {
const motd = await pingBedrock("geo.hivebedrock.network");
console.log("--- Bedrock Server ---");
console.log(motd);
} catch (error) {
console.error("Could not ping Bedrock server:", error);
}