Add debug logs using the `debug` library.
To use this new feature, set the `DEBUG` environment variable:
- `DEBUG=mineping:*` enables all logs from this library.
- `DEBUG=mineping:java` enables logs for the Java module only.
- `DEBUG=mineping:bedrock` enables logs for the Bedrock module only.
Add support for DNS SRV record lookups (`_minecraft._tcp`) to
automatically resolve the correct server host and port, falling back
to the provided address if no record is found. This makes server
discovery compliant with standard Minecraft client behavior.
The Java ping implementation has been refactored:
- The `varint` module is rewritten to throw specific error codes and
its `decodeVarInt` function now returns bytes read, which simplifies
parsing logic.
- The core ping logic is now promise-based and modular, breaking out
packet creation and response processing into helper functions.
- The TCP stream handler now robustly processes chunked data by
catching recoverable decoder errors and waiting for more data,
preventing crashes on incomplete packets.
- Error handling is improved.
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