mirror of
https://github.com/minescope/mineping.git
synced 2025-07-14 00:44:37 +03:00
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:
19
examples/01-basic-ping.js
Normal file
19
examples/01-basic-ping.js
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user