Closed OguzhanUmutlu closed 2 years ago
Await example:
const data = await ping.promise({ ip: "play.hyperlandsmc.net", port: 19132, timeout: 3000 });
Await example with try/catch:
try { const data = await ping.promise({ ip: "play.hyperlandsmc.net", port: 19132, timeout: 3000 }); } catch(err) { console.error(err); }
Then/catch example:
ping.promise({ ip: "play.hyperlandsmc.net", port: 19132, timeout: 3000 }) .then(data => { console.log(data); }) .catch(console.error);
Await example:
Await example with try/catch:
Then/catch example: