0.1.3 • Published 19 days ago

minecraft-server-ping v0.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
19 days ago

minecraft-ping

Minecraft server ping utility

Based on https://www.npmjs.com/package/minecraft-pinger javascript version.

Hostname & Port object and URL can be provided as direct value, with Promise or callback function (sync or async).

API Documentation

See API Documentation;

const data = await ping(); // localhost:25565
const data = await ping(Promise.resolve({hostname: 'eu.mineplex.com'}));
const data = await ping(() => {hostname: 'eu.mineplex.com', port: 25565});
const data = await ping(() => Promise.resolve({hostname: 'eu.mineplex.com', port: 25565}), {timeout: 100}); // timeout 100ms
const data = await pingUri('minecraft://eu.mineplex.com');
const data = await pingUri(new URL('minecraft://eu.mineplex.com:25565'));

or using Result

const result: Result<IMinecraftData, Error> = await pingUriResult('minecraft://eu.mineplex.com'); // or pingResult({server: 'eu.mineplex.com', port: 25565})
// with logic
if (result.isOk) {
	console.log(result.ok()); // IMinecraftData
} else {
	console.log(result.err().message); // Error message
}
// or with throw
const data: IMinecraftData = result.unwrap(); // throws error if Result is Error
0.1.3

19 days ago

0.0.10

12 months ago

0.0.11

12 months ago

0.0.12

11 months ago

0.0.13

10 months ago

0.1.0

10 months ago

0.1.2

9 months ago

0.1.1

10 months ago

0.0.9

1 year ago

0.0.8

2 years ago

0.0.5

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

4 years ago

0.0.1

5 years ago