refactoring and comments

fix(cli.js): refactor help and error handling logic for better readability and maintainability
feat(cli.js): add support for custom port and timeout options
fix(parallel.js): update list of hosts to ping
fix(bedrock.js): add comments and improve error handling in ping function
fix(java.js): add comments and improve error handling in ping function
fix(varint.js): add comments to functions and improve readability
fix(index.d.ts): export all functions from java.js and bedrock.js
fix(lib/bedrock.d.ts): update source link
fix(lib/java.d.ts): update source link
This commit is contained in:
2023-10-22 21:32:00 +03:00
parent 915edbec9c
commit 910184bf5f
8 changed files with 148 additions and 59 deletions

View File

@ -1,10 +1,19 @@
import { pingBedrock } from '../index.js';
const [thehive, oasys, frizmine, breadix] = await Promise.allSettled([
pingBedrock('geo.hivebedrock.network'),
pingBedrock('oasys-pe.com'),
pingBedrock('frizmine.ru'),
pingBedrock('play.breadixpe.ru')
]);
const hosts = [
'play.timecrack.net',
'geo.hivebedrock.network',
'oasys-pe.com',
'play.galaxite.net',
];
console.dir({ thehive, oasys, frizmine, breadix }, { depth: 3 });
const pingPromises = hosts.map(host => pingBedrock(host));
const results = await Promise.allSettled(pingPromises);
for (let result of results) {
if (result.status === 'rejected') {
console.error(result.reason);
}
console.log(result.value);
}